ModuleNotFoundError: No module named 'pkg_resources'
See original GitHub issueThe docker environment where we run our tests has been failing since yesterday morning (10th February) with a ModuleNotFoundError: No module named 'pkg_resources'
error.
After some investigation, we noticed it upgraded setuptools to version 45.2.0 on that morning.
Downgrading setuptools to 45.1.0 fixed our issue, and everything is working as expected again.
There might have been some change in 45.2.0 that triggered this issue. Let me know what other information I can provide.
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 338, in execute
django.setup()
File "/venv/lib/python3.6/site-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/venv/lib/python3.6/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/venv/lib/python3.6/site-packages/django/apps/config.py", line 94, in create
module = import_module(entry)
File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/venv/lib/python3.6/site-packages/nested_admin/__init__.py", line 10, in <module>
import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:5 (2 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 >No module named 'pkg_resources' in Python | bobbyhadz
The Python "No module named 'pkg_resources'" occurs when setuptools is not installed in our Python environment. To solve the error, ...
Read more >No module named 'pkg_resources' when installing ... - GitHub
Hi. I'm getting the error below both on Python 3.10.0 and 3.9.7, only on this mirrors-prettier repo. [INFO] Installing environment for ...
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 >ImportError: No module named pkg_resources - Ask Ubuntu
pkg_resources is a dependency of setuptools. Open the terminal and type: sudo apt install --reinstall python3-pkg-resources ...
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
We found out that using the inbuilt
venv
instead ofvirtualenv
(using setuptools 45.2.0) actually also workedHi @alexscott-ff , could you please share with us a minimal reproducible example that demonstrates a (simplied) situation when this error happens (as mentioned by Jason)?