July 2018 Update

Most people should now use pip install setuptools (possibly with sudo).

Some may need to (re)install the python-setuptools package via their package manager (apt-get install, yum install, etc.).

This issue can be highly dependent on your OS and dev environment. See the legacy/other answers below if the above isn't working for you.

Explanation

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 to below is no longer the recommended installation method.

The bootstrap script instructions will remain below, in case it's still helpful to anyone.

Legacy Answer

I encountered the same ImportError today while trying to use pip. Somehow the setuptools package had been deleted in my Python environment.

To fix the issue, run the setup script for setuptools:

wget https://bootstrap.pypa.io/ez_setup.py -O - | python

(or if you don't have wget installed (e.g. OS X), try

curl https://bootstrap.pypa.io/ez_setup.py | python

possibly with sudo prepended.)

If you have any version of distribute, or any setuptools below 0.6, you will have to uninstall it first.*

See Installation Instructions for further details.


* If you already have a working distribute, upgrading it to the "compatibility wrapper" that switches you over to setuptools is easier. But if things are already broken, don't try that.

Answer from cwc on Stack Overflow
🌐
Haiku
discuss.haiku-os.org › software
Pip3 not working - No module named 'pkg_resources' - Software - Haiku Community
June 11, 2019 - Dear all, I am currently experimenting with Haiku. As I am mainly programming in Python, I tried to see if I could switch to work in Haiku. I am running Haiku version R1/beta1 (Revision hrev52295+129) at the moment currently in Virtualbox via the (official?) Vagrantbox, see https://app.vagrantup.com/haiku-os/boxes/r1beta1-x86_64 I installed Python 3 and the corresponding pip via ~> pkgman install python3 ~> pkgman install pip_python3 The installation process works fine and Python itself see...
🌐
GitHub
github.com › Data-Centric-AI-Community › fg-data-profiling › issues › 1618
ModuleNotFoundError: No module named 'pkg_resources' · Issue #1618 · Data-Centric-AI-Community/fg-data-profiling
July 12, 2024 - Traceback (most recent call last): File "c:\Users\foo\test.py", line 9, in <module> import ydata_profiling File "C:\Users\foo\AppData\Local\pypoetry\Cache\virtualenvs\foo-nnQxNQNi-py3.12\Lib\site-packages\ydata_profiling\__init__.py", line 14, in <module> from ydata_profiling.compare_reports import compare # isort:skip # noqa ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\foo\AppData\Local\pypoetry\Cache\virtualenvs\foo-nnQxNQNi-py3.12\Lib\site-packages\ydata_profiling\compare_reports.py", line 12, in <module> from ydata_profiling.profile_report import ProfileReport File "C:\Users\foo\AppData\Local\pypoetry\Cache\virtualenvs\foo-nnQxNQNi-py3.12\Lib\site-packages\ydata_profiling\profile_report.py", line 9, in <module> import pkg_resources ModuleNotFoundError: No module named 'pkg_resources'
Discussions

"No module named pkg_resources" on Python 3.12 due to missing "setuptools"
Describe the bug Running 0.45.24 on Python 3.12. It will not be able to work because "setuptools" is missing Version ChangeDetection 0.45.24. Python 3.12.4 To Reproduce Steps to reproduce the behav... More on github.com
🌐 github.com
June 17, 2024
ModuleNotFoundError: No module named 'pkg_resources'
What should i do? Ask the community or our support engineers for answers to questions. More on discuss.streamlit.io
🌐 discuss.streamlit.io
2
0
June 17, 2020
with setuptools v70.0.0: `ModuleNotFoundError: No module named 'pkg_resources.extern'`
Description of the issue I have added some TODO notes below but wanted to submit this sooner than later for any other users running into this issue today to be able to find it. This morning I notic... More on github.com
🌐 github.com
May 21, 2024
No module named 'pkg_resources'
Hey Isaac, I am currently installing ipyrad on a Windows machine but through WSL. Following other comment and issue threads, I am using a unique conda environment, and specifically one with python ... More on github.com
🌐 github.com
February 12, 2026
Top answer
1 of 16
983

July 2018 Update

Most people should now use pip install setuptools (possibly with sudo).

Some may need to (re)install the python-setuptools package via their package manager (apt-get install, yum install, etc.).

This issue can be highly dependent on your OS and dev environment. See the legacy/other answers below if the above isn't working for you.

Explanation

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 to below is no longer the recommended installation method.

The bootstrap script instructions will remain below, in case it's still helpful to anyone.

Legacy Answer

I encountered the same ImportError today while trying to use pip. Somehow the setuptools package had been deleted in my Python environment.

To fix the issue, run the setup script for setuptools:

wget https://bootstrap.pypa.io/ez_setup.py -O - | python

(or if you don't have wget installed (e.g. OS X), try

curl https://bootstrap.pypa.io/ez_setup.py | python

possibly with sudo prepended.)

If you have any version of distribute, or any setuptools below 0.6, you will have to uninstall it first.*

See Installation Instructions for further details.


* If you already have a working distribute, upgrading it to the "compatibility wrapper" that switches you over to setuptools is easier. But if things are already broken, don't try that.

2 of 16
153
sudo apt-get install --reinstall python-pkg-resources

fixed it for me in Debian. Seems like uninstalling some .deb packages (twisted set in my case) has broken the path python uses to find packages

🌐
Cosmoscalibur
cosmoscalibur.com › home › no module named pkg_resources found in uv environment
No module named pkg_resources found in UV environment — Cosmoscalibur
February 23, 2026 - Starting February 8, 2026, setuptools v82 removed the pkg_resources module. If you experience this error after that date, the likely cause is the setuptools upgrade. The solution is to pin the version to the previous one, e.g., setuptools<82.
🌐
GitHub
github.com › dgtlmoon › changedetection.io › issues › 2422
"No module named pkg_resources" on Python 3.12 due to missing "setuptools" · Issue #2422 · dgtlmoon/changedetection.io
June 17, 2024 - The error only happens when it actually tries to detect changes for a URL (or any URL). Every URL ends up with "No module named pkg_resources" error, and that's the only error message from the console.
🌐
Streamlit
discuss.streamlit.io › using streamlit
ModuleNotFoundError: No module named 'pkg_resources' - Using Streamlit - Streamlit
June 17, 2020 - What should i do? Ask the community or our support engineers for answers to questions.
Find elsewhere
🌐
GitHub
github.com › pyinstaller › pyinstaller › issues › 8554
with setuptools v70.0.0: `ModuleNotFoundError: No module named 'pkg_resources.extern'` · Issue #8554 · pyinstaller/pyinstaller
May 21, 2024 - import tendo.singleton def main(): print("Hello World!") if __name__ == "__main__": me = tendo.singleton.SingleInstance() main() ... Traceback (most recent call last): File "Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_pkgres.py", line 158, in <module> File "Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_pkgres.py", line 36, in _pyi_rthook File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module File "pkg_resources\__init__.py", line 77, in <module> ModuleNotFoundError: No module named 'pkg_resources.extern' [2288] Failed to execute script 'pyi_rth_pkgres' due to unhandled exception!
🌐
Arshan's blogs
blog.arshanaslam.me › fixing-no-module-named-pkgresources-after-setuptools-82-removal
Fixing “No module named 'pkg_resources'” After Setuptools 82 Removal
February 11, 2026 - If your project or dependencies still rely on pkg_resources, install a Setuptools version below 82. ... This restores the pkg_resources module.
🌐
GitHub
github.com › dereneaton › ipyrad › issues › 620
No module named 'pkg_resources' · Issue #620 · dereneaton/ipyrad
February 12, 2026 - Traceback (most recent call last): File "/home/jrroberts6/anaconda3/envs/ipyrad_py312/bin/ipyrad", line 6, in <module> from ipyrad.__main__ import main File "/home/jrroberts6/anaconda3/envs/ipyrad_py312/lib/python3.12/site-packages/ipyrad/__main__.py", line 8, in <module> from pkg_resources import get_distribution ModuleNotFoundError: No module named 'pkg_resources'
🌐
GitHub
github.com › pypa › setuptools › issues › 5174
[BUG] Restore `pkg_resources` · Issue #5174 · pypa/setuptools
February 9, 2026 - The entire reason for build_meta.__legacy__ existence is to allow us to continue using packages that haven't migrated to newer packaging standards, whether that is because the packages are no longer maintained or we're intentionally testing older versions (for e.g. stable or historical release branches). Removing pkg_resources breaks this contract owing to pkg_resources's use as a build-time dependency for things like namespace packages.
🌐
Reddit
reddit.com › r/love2d › no module named 'pkg_resources' error while building love game
r/love2d on Reddit: No module named 'pkg_resources' error while building love game
June 11, 2024 -

I got this error when trying to build my love2d game with makelove: * Executing task: C:\Users\Eli\AppData\Local\Programs\Python\Python312\Scripts\makelove.exe --config make_all.toml

Traceback (most recent call last):

File "<frozen runpy>", line 198, in _run_module_as_main

File "<frozen runpy>", line 88, in _run_code

File "C:\Users\Eli\AppData\Local\Programs\Python\Python312\Scripts\makelove.exe\__main__.py", line 4, in <module>

File "C:\Users\Eli\AppData\Local\Programs\Python\Python312\Lib\site-packages\makelove\makelove.py", line 11, in <module>

import pkg_resources

ModuleNotFoundError: No module named 'pkg_resources'

* The terminal process "C:\Users\Eli\AppData\Local\Programs\Python\Python312\Scripts\makelove.exe '--config', 'make_all.toml'" terminated with exit code: 1.

* Terminal will be reused by tasks, press any key to close it.

How do i fix this?

🌐
GitHub
github.com › lmcinnes › umap › issues › 1065
No module named 'pkg_resources' · Issue #1065 · lmcinnes/umap
October 10, 2023 -  python umap_1.py Traceback (most recent call last): File "/home/ethan/code/umap_1.py", line 2, in <module> import umap File "/home/ethan/code/.venv/lib/python3.11/site-packages/umap/__init__.py", line 36, in <module> import pkg_resources ModuleNotFoundError: No module named 'pkg_resources'
Author: lmcinnes
🌐
Liquid Instruments
knowledge.liquidinstruments.com › python-api-examples › moku-library-pkg_resource-error-fix
Fix for ''No module named pkg_resources" error - Liquid Instruments
August 29, 2024 - During installation of the Moku API on the latest versions of Python (>3.12), the installation may encounter an error No module named ‘pkg_resources' when the command moku download is run.
🌐
Frappe
discuss.frappe.io › t › bench-new-site-throws-error-no-module-named-pkg-resources › 160415
Bench new-site throws Error: No module named ‘pkg_resources’ - Frappe Forum
February 9, 2026 - Hi, On a new install (Ubuntu 22.04, Python 3.10), trying to run the bench new-site command results in the following error: ImportError: Module import failed for Dropbox Settings, the DocType you’re trying to open might be deleted. Error: No module named ‘pkg_resources’ I’ve tried ...
🌐
GitHub
github.com › seemoo-lab › opendrop › issues › 122
All commands return "ModuleNotFoundError: No module named 'pkg_resources'" · Issue #122 · seemoo-lab/opendrop
December 2, 2024 - Every time I try to run a command from opendrop it just returns some file tracebacks and then ModuleNotFoundError: No module named 'pkg_resources' I have tried installing, upgrading and reinstalling setuptools through apt, pip and pipx but nothing changes.
🌐
Streamlit
discuss.streamlit.io › community cloud
ModuleNotFoundError: No module named 'pkg_resources' when deploying - Community Cloud - Streamlit
February 18, 2026 - Link to the app: https://eqseismfm-bmkg-alt.streamlit.app/ Link to the Github repository: GitHub - GalihPRep/EQ_Seism_FM Error message: /home/adminuser/venv/lib/python3.10/site-packages/streamlit/runtime/scriptru …
🌐
Python.org
discuss.python.org › python help
Why module pkg_resources is not found - Python Help - Discussions on Python.org
November 22, 2024 - When starting the process, an error occurs that the system cannot find the pkg_resource module, I checked the presence of setuptools and pkg_resources in the folder (IT exists, it is there), I thought that an error occurred and deleted setuptools pip uninstall setuptools and then downloaded ...
🌐
Medium
medium.com › @sherlock297 › error-modulenotfounderror-no-module-named-pkg-resources-e64548127db3
Error — ModuleNotFoundError: No module named ‘pkg_resources’ - Ravindra Dagale - Medium
August 31, 2024 - Error — ModuleNotFoundError: No module named ‘pkg_resources’ If you receive this type of error try below solution. Error: C:\Users\User\Downloads\dnsReaper-1.10.0\dnsReaper-1.10.0>python …