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

🌐
Reddit
reddit.com › r/learnpython › impossible to get pkg_resources on windows?
r/learnpython on Reddit: Impossible to get pkg_resources on Windows?
February 13, 2026 -

I am running on Windows Powershell. I know, it sucks, but it is what I am stuck with.

I have installed python 3.14 from the python.org website. When I run python and run "import setuptools", it works. When I check the version of setuptools, it is 82.0.0. No problems there.

But pkg_resources will not import. Specifically, "import pkg_resources" always fails.

I have reinstalled using --force-reinstall, I have downloaded the setuptools wheel file, none of that works. It just will not recognize pkg_resources.

Is there no pkg_resources file for Windows? Or what on earth is going on here? Every guide I read just keeps repeating that I should reinstall, but I have done that, multiple times, from multiple sources.

Discussions

`pkg_resources` is deprecated and removed in Python 3.12
Python 3.12 has removed pkg_resources from the standard library (moved to setuptools): https://docs.python.org/3/whatsnew/3.12.html · gh-95299: Do not pre-install setuptools in virtual environments created with venv. More on github.com
🌐 github.com
December 27, 2023
"No module named pkg_resources" on Python 3.12 due to missing "setuptools"
Python 3.12.4 ... Solution pip install setuptools and it will work. ... I installed by pip install changedetection.io. I want to clarify that the installation is totally fine - Nothing wrong happens during installation. 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... More on github.com
🌐 github.com
June 17, 2024
Why module pkg_resources is not found
When starting the process, an error ... 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 again pip install setuptools The installation was successful ... More on discuss.python.org
🌐 discuss.python.org
1
0
November 22, 2024
ModuleNotFoundError: No module named 'pkg_resources' when installing environment
I wonder if it has something to do with my NodeJS installation, but I'm not sure and I don't know how to debug it. Let me know if I have to post more information about my system. Below is what I tried so far, to no success. I'd appreciate any lead, hint or help. ... ❯ /Users/aa/.pyenv/versions/3.10.0/bin/python3 ... More on github.com
🌐 github.com
9
November 6, 2021
🌐
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.
🌐
PyPI
pypi.org › project › micropython-pkg_resources
micropython-pkg_resources · PyPI
pkg_resources module for MicroPython · pip install micropython-pkg_resources Copy PIP instructions
🌐
Its Linux FOSS
itslinuxfoss.com › home › fix: no module named pkg_resources
Fix: no module named pkg_resources – Its Linux FOSS
December 27, 2022 - The error “no module named pkg_resources” can be resolved by installing the python package via “sudo apt install python-pkg-resources”.
🌐
GitHub
github.com › mu-editor › mu › issues › 2485
`pkg_resources` is deprecated and removed in Python 3.12 · Issue #2485 · mu-editor/mu
December 27, 2023 - This means that distutils, setuptools, pkg_resources, and easy_install will no longer available by default; to access these run pip install setuptools in the activated virtual environment.
🌐
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.
Find elsewhere
🌐
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 - Python 3.12.4 ... Solution pip install setuptools and it will work. ... I installed by pip install changedetection.io. I want to clarify that the installation is totally fine - Nothing wrong happens during installation.
🌐
Python
python.org › dev › peps › pep-0365
PEP 365 -- Adding the pkg_resources module | Python.org
April 30, 2007 - In addition, with one feature addition, this module could support easy bootstrap installation of several Python package management tools, including setuptools, workingenv, and zc.buildout. Rather than proposing to include setuptools in the standard library, this PEP proposes only that pkg_resources be added to the standard library for Python 2.6 and 3.0.
🌐
Bobby Hadz
bobbyhadz.com › blog › python-no-module-named-pkg-resources
No module named 'pkg_resources' in Python [Solved] | bobbyhadz
... Copied!# python2 and Windows python -m pip install --upgrade setuptools # for Python3 on macOS or Linux python3 -m pip install --upgrade setuptools # 👇️ using an alias on Windows py -m pip install --upgrade setuptools
🌐
Python
peps.python.org › pep-0365
PEP 365 – Adding the pkg_resources module | peps.python.org
April 30, 2007 - In addition, with one feature addition, this module could support easy bootstrap installation of several Python package management tools, including setuptools, workingenv, and zc.buildout. Rather than proposing to include setuptools in the standard library, this PEP proposes only that pkg_resources be added to the standard library for Python 2.6 and 3.0.
🌐
PyPI
pypi.org › project › lambda-pkg-resources
lambda-pkg-resources · PyPI
January 6, 2021 - This will install watchtower and python-jose in "packages/install/directory", excluding the package six anywhere it is found in the dependency tree. This package is used in lambda-setuptools to remove all of the libraries listed in LAMBDA_EXCLUDES from the built package or library using the ldist command. ... Download the file for your platform. If you're not sure which to choose, learn more about installing packages. lambda-pkg-resources-0.0.6.tar.gz (9.5 kB view details)
      » pip install lambda-pkg-resources
    
Published: Sep 08, 2021
Version: 0.0.6
🌐
Google Groups
groups.google.com › g › trac-users › c › 9_FC90ghxp0
Windows install - missing pkg_resources module
> >> Not sure of the actual procedure to install (docs are very unfriendly! > >> IMHO) > >> So I started with this initenv, and got this .... > > >> C:\Python27\Scripts>trac-admin.exe \Trac\JESS-PROJECT initenv > >> Traceback (most recent call last): > >> File "C:\Python27\Scripts\trac-admin-script.py", line 5, in <module> > >> from pkg_resources import load_entry_point > >> ImportError: No module named pkg_resources > > That module is part of setuptools, which you need to install first.
🌐
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 ... 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 again pip install setuptools The installation was successful ...
🌐
PyPI
pypi.org › project › setuptools › 8.1
setuptools · PyPI
Fix for encoding issue when installing from Windows executable on Python 3. Distribute #323: Allow setup_requires requirements to supercede installed requirements. Added some new keyword arguments to existing pkg_resources methods.
🌐
PyPI
pypi.org › project › types-pkg-resources
types-pkg-resources
JavaScript is disabled in your browser. Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
🌐
EasyAsLinux
easyaslinux.com › home › fix for ‘importerror: no module named pkg_resources’ error
Fix for 'ImportError: No module named pkg_resources' error » Easy as Linux
March 26, 2019 - You will see this error when you try to install a PIP package. This error message means Python setuptools is missing or broken. $sudo pip2.7 Traceback (most recent call last): File "/usr/bin/pip2.7", line 6, in from pkg_resources import load_entry_point ImportError: No module named pkg_resources #Fix1: Just re-install the Python setuptools to fix the […]
🌐
Google Groups
groups.google.com › g › comp.lang.python › c › boY2M05var4
Cannot install pkg_resources using pip
April 16, 2023 - That being said, if you start from ... python3 --version python3.9 --version pkg_resources is inside of setuptools so you would run python3.9 -m pip install setuptools (might already be there with the reinstall) after that run python3.9 then run import pkg_resources import ...
🌐
GitHub
github.com › pre-commit › pre-commit › issues › 2122
ModuleNotFoundError: No module named 'pkg_resources' when installing environment · Issue #2122 · pre-commit/pre-commit
November 6, 2021 - I wonder if it has something to do with my NodeJS installation, but I'm not sure and I don't know how to debug it. Let me know if I have to post more information about my system. Below is what I tried so far, to no success. I'd appreciate any lead, hint or help. ... ❯ /Users/aa/.pyenv/versions/3.10.0/bin/python3 -m pip install -U pip setuptools Requirement already satisfied: pip in /Users/aa/.pyenv/versions/3.10.0/lib/python3.10/site-packages (21.3.1) Requirement already satisfied: setuptools in /Users/aa/.pyenv/versions/3.10.0/lib/python3.10/site-packages (58.5.3)
Author: pre-commit