question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Convolution import error with setuptools v65.6.0

See original GitHub issue

setuptools 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:closed
  • Created 10 months ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

3reactions
Cadaircommented, Nov 21, 2022

Am I correct in the understanding that the long term answer he is that we need to stop using numpy.distutils ?

0reactions
pllimcommented, Nov 28, 2022

Thanks, all!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found