Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brian2 import fails with latest setuptools (version 74.0.0) #1557

Closed
bvogginger opened this issue Aug 28, 2024 · 4 comments · Fixed by #1558
Closed

brian2 import fails with latest setuptools (version 74.0.0) #1557

bvogginger opened this issue Aug 28, 2024 · 4 comments · Fixed by #1558

Comments

@bvogginger
Copy link

brian2 import fails with version 74 from setuptools due to changes about handling the MVSC compiler Changelog

To reproduce it:

$ conda create -n test_brian python==3.10
$ conda activate test_brian
$ pip install --upgrade setuptools
$ pip install brian2
$ python
$ >>> import brian2

Output of brian2 import:

Python 3.10.0 (default, Mar  3 2022, 09:58:08) [GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import brian2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/vogginger/miniconda3/envs/test_brian/lib/python3.10/site-packages/brian2/__init__.py", line 91, in <module>
    from brian2.only import *
  File "/home/vogginger/miniconda3/envs/test_brian/lib/python3.10/site-packages/brian2/only.py", line 28, in <module>
    from brian2.core.clocks import *
  File "/home/vogginger/miniconda3/envs/test_brian/lib/python3.10/site-packages/brian2/core/clocks.py", line 11, in <module>
    from brian2.groups.group import VariableOwner
  File "/home/vogginger/miniconda3/envs/test_brian/lib/python3.10/site-packages/brian2/groups/__init__.py", line 5, in <module>
    from .group import *
  File "/home/vogginger/miniconda3/envs/test_brian/lib/python3.10/site-packages/brian2/groups/group.py", line 17, in <module>
    from brian2.codegen.codeobject import create_runner_codeobj
  File "/home/vogginger/miniconda3/envs/test_brian/lib/python3.10/site-packages/brian2/codegen/__init__.py", line 9, in <module>
    from .runtime import *
  File "/home/vogginger/miniconda3/envs/test_brian/lib/python3.10/site-packages/brian2/codegen/runtime/__init__.py", line 18, in <module>
    from .numpy_rt import *
  File "/home/vogginger/miniconda3/envs/test_brian/lib/python3.10/site-packages/brian2/codegen/runtime/numpy_rt/__init__.py", line 9, in <module>
    from .numpy_rt import *
  File "/home/vogginger/miniconda3/envs/test_brian/lib/python3.10/site-packages/brian2/codegen/runtime/numpy_rt/numpy_rt.py", line 21, in <module>
    from ...generators.numpy_generator import NumpyCodeGenerator
  File "/home/vogginger/miniconda3/envs/test_brian/lib/python3.10/site-packages/brian2/codegen/generators/__init__.py", line 12, in <module>
    from .cpp_generator import *
  File "/home/vogginger/miniconda3/envs/test_brian/lib/python3.10/site-packages/brian2/codegen/generators/cpp_generator.py", line 5, in <module>
    from brian2.codegen.cpp_prefs import C99Check
  File "/home/vogginger/miniconda3/envs/test_brian/lib/python3.10/site-packages/brian2/codegen/cpp_prefs.py", line 22, in <module>
    from setuptools import msvc
ImportError: cannot import name 'msvc' from 'setuptools' (/home/vogginger/miniconda3/envs/test_brian/lib/python3.10/site-packages/setuptools/__init__.py)
>>> 
@github-staff github-staff deleted a comment Aug 28, 2024
@mstimberg
Copy link
Member

Many thanks. I am on vacation but will look into it next week.

@neworderofjamie
Copy link

Having taken 'inspiration' from your use of setuptools.msvc for GeNN, I'm keen to know what you come up with! Happy to test/provide MSVC knowledge.

@neworderofjamie
Copy link

Cause of the issue is pypa/setuptools#4600. It also seems to affect CuPy cupy/cupy#8568 - will be good to see how they fix the runtime aspect.

@bvogginger
Copy link
Author

Thanks a lot @mstimberg for the fix!

@github-staff github-staff deleted a comment from ViniciusSCG Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@bvogginger @mstimberg @neworderofjamie and others