[BUG] Unable to import pkg_resources before setuptools
See original GitHub issuesetuptools version
60.9.3 (also affects the main branch)
Python version
Python 3.7 from PyPy 7.3.7
OS
macOS
Additional environment information
Using packages from conda-forge.
Description
Importing pkg_resources
before setuptools
results in setuptools
being broken with AttributeError: module 'setuptools' has no attribute 'version'
.
Expected behavior
The import order doesn’t matter.
How to Reproduce
> conda create -c conda-forge --name test setuptools pypy
> conda activate test
> python -c 'import setuptools, pkg_resources; print("All good")'
All good
> python -c 'import pkg_resources, setuptools; print("All good")'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/cburr/mambaforge/envs/test/site-packages/setuptools/__init__.py", line 35, in <module>
__version__ = setuptools.version.__version__
AttributeError: module 'setuptools' has no attribute 'version'
Output
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/cburr/mambaforge/envs/test/site-packages/setuptools/__init__.py", line 35, in <module>
__version__ = setuptools.version.__version__
AttributeError: module 'setuptools' has no attribute 'version'
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
No module named pkg_resources - python - Stack Overflow
This error message is caused by a missing/broken Python setuptools package. Per Matt M.'s comment and setuptools issue #581, the bootstrap script referred ......
Read more >1222389 – [abrt] python-pip: pip:5:<module>:ImportError: No ...
When you launch "sudo python", and then type "import pkg_resources" in the interactive interpreter, do you get a backtrace as well?
Read more >The error was: ImportError: No module named pkg_resources
Hi,. I am new to the Koa deployment. I'm trying to install the builds (Koa.2, Koa.2a, Koa.Master), everything show different error each time ......
Read more >Fix for 'ImportError: No module named pkg_resources' error
You will see this error when you try to install a PIP package. This error message means Python setuptools is missing or broken....
Read more >setuptools-scm - PyPI
from pkg_resources import get_distribution, DistributionNotFound try: ... If this is unset (the default), setuptools_scm will error if it fails to detect ...
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
I’ve opened an issue for PyPy: https://foss.heptapod.net/pypy/pypy/-/issues/3703
I’ll follow up here when there is a response.
Hi Cris, yes! Thank you very much for spotting the problem and coordinating a solution with the PyPy team! ❤️ 💚 💛 💙
I can see that they are planning a release including the changes you proposed https://foss.heptapod.net/pypy/pypy/-/commit/a1b1b3169deb1d309c88c1ba3cfef6fb069ddc6a
Hopefully it will be out soon 🤞