Convolution import error with setuptools v65.6.0
See original GitHub issuesetuptools v65.6.0 made a change in their bundled version of distutils, which is breaking the import of the compiled extension in convolution
, which is done with numpy.ctypeslib.load_library
(which depends on numpy.distutils
).
Some of our builds are failing (currently RTD and wheels, but it seems the tox based one are still using the previous version of setuptools, probably because virtualenv did not update yet):
Traceback:
../astropy/astropy/test-sdist/lib/python3.11/site-packages/astropy/convolution/convolve.py:28: in <module>
_convolve = load_library("_convolve", LIBRARY_PATH)
../astropy/astropy/test-sdist/lib/python3.11/site-packages/numpy/ctypeslib.py:137: in load_library
from numpy.distutils.misc_util import get_shared_lib_extension
../astropy/astropy/test-sdist/lib/python3.11/site-packages/numpy/distutils/__init__.py:26: in <module>
from . import ccompiler
../astropy/astropy/test-sdist/lib/python3.11/site-packages/numpy/distutils/ccompiler.py:20: in <module>
from numpy.distutils import log
../astropy/astropy/test-sdist/lib/python3.11/site-packages/numpy/distutils/log.py:4: in <module>
from distutils.log import Log as old_Log
E ImportError: cannot import name 'Log' from 'distutils.log' (/home/runner/work/astropy/astropy/test-sdist/lib/python3.11/site-packages/setuptools/_distutils/log.py)
Ref https://github.com/numpy/numpy/issues/22623, https://github.com/pypa/setuptools/issues/3693
Issue Analytics
- State:
- Created 10 months ago
- Comments:13 (13 by maintainers)
Top Results From Across the Web
Error with imports after packaging using setup tools
I am not getting any errors when I try to import it from the project's parent directory and I am able to run...
Read more >Full Changelog — Astropy v5.2
Fix import error with setuptools v65.6.0 by replacing numpy.ctypeslib.load_library with Cython to load the C convolution extension. [#14035] ...
Read more >History - setuptools 65.6.3.post20221216 documentation
#3178: Postponed importing ctypes when hiding files on Windows. This helps to prevent errors in systems that might not have libffi installed. #3179:...
Read more >setuptools 6.1
Issue #12: Namespace packages are now imported lazily. That is, the mere declaration of a namespace package in an egg on sys.path no...
Read more >How to Package Python dependencies with PIP setuptools
If you get a permissions error, instead of using sudo, consider creating a ... from distutils.core import setup from setuptools import ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Am I correct in the understanding that the long term answer he is that we need to stop using
numpy.distutils
?Thanks, all!