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
982

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

🌐
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 ...
Discussions

Impossible to get pkg_resources on Windows?
pkg_resources was removed from setuptools after v81. You need to install an earlier version of setuptools (I ran into this exact issue yesterday actually lol) More on reddit.com
🌐 r/learnpython
9
2
February 13, 2026
`pkg_resources` is deprecated and removed in Python 3.12
gh-95299: Do not pre-install setuptools in virtual environments created with venv. 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. More on github.com
🌐 github.com
December 27, 2023
Pip3 not working - No module named 'pkg_resources' - Software - Haiku Community
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.vag... More on discuss.haiku-os.org
🌐 discuss.haiku-os.org
2
June 11, 2019
Can't run pip: ModuleNotFoundError: No module named 'pkg_resources', setuptools is installed

Do you have all of the dependencies for python3-setuptools? In particular do you have python3-packaging installed? If you open yast and select "Dependencies > Check Now" does it say "All package dependencies are OK."?

the directory pkg_resources should be in /usr/lib/python3.8/site-packages

More on reddit.com
🌐 r/openSUSE
5
2
August 13, 2020
🌐
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 - 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" error, and that's the only error message from the console.
🌐
PyPI
pypi.org › project › micropython-pkg_resources
micropython-pkg_resources · PyPI
pkg_resources module for MicroPython · pip install micropython-pkg_resources Copy PIP instructions
🌐
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 - This restores the pkg_resources module. ... because this allows pip to install Setuptools 82+, which removes pkg_resources and recreates the error.
🌐
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.

Find elsewhere
🌐
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 - Python 3.12 has removed pkg_resources from the standard library (moved to setuptools): https://docs.python.org/3/whatsnew/3.12.html
🌐
PyPI
pypi.org › project › types-pkg-resources
types-pkg-resources · PyPI
Typing stubs for pkg_resources · pip install types-pkg-resources Copy PIP instructions · This is an auto-generated PEP 561 type stub package for pkg_resources package. It can be used by type-checking tools like mypy, PyCharm, pytype etc. to check code that uses pkg_resources.
🌐
Arch Linux Forums
bbs.archlinux.org › viewtopic.php
using pip from archlinux : No module named 'pkg_resources' / Programming & Scripting / Arch Linux Forums
September 14, 2018 - ``` pip install presto-python-client Traceback (most recent call last): File "/usr/bin/pip", line 6, in <module> from pkg_resources import load_entry_point ModuleNotFoundError: No module named 'pkg_resources' ```
🌐
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...
🌐
Reddit
reddit.com › r/opensuse › can't run pip: modulenotfounderror: no module named 'pkg_resources', setuptools is installed
r/openSUSE on Reddit: Can't run pip: ModuleNotFoundError: No module named 'pkg_resources', setuptools is installed
August 13, 2020 -

Edit: Problem solved The packages python3 python3-base and python3-devel were installed from the Leap 15.1 Repo and there was a file conflict with the python38 package from the "Main Repository (OSS)" Repo.

I did a zypper rm python3 python3-base python3-devel to remove the packages from the Leap 15.1 Repo and force installed python38, python38-base and python38-devel to install the correct packages again without any file conflicts.

I still don't know whether i should even have the Leap 15.1 Repo though ...
I have disabled the repo now.

---Original Post---

Hello,

when i want to execute any pip command (including just invoking pip without any args) i get the following error:

$ pip
 Traceback (most recent call last):
   File "/usr/bin/pip", line 6, in <module>
     from pkg_resources import load_entry_point
 ModuleNotFoundError: No module named 'pkg_resources'

I already searched and often when people got this error it was due to a missing setuptools package.

But python3-setuptools is installed via zypper. And pip is the one from python 3.

When i start python3 and run help("modules") many modules are listed but setuptools isn't among them, yet /usr/lib/python3.8/site-packages/setuptools exists and is not empty.

Not sure if related, but i also can't start lutris(also installed with zypper):

$ lutris
Unable to load locale dir, translations won't work.
Traceback (most recent call last):
  File "/usr/bin/lutris", line 54, in <module>
    from lutris.gui.application import Application  # pylint: disable=no-name-in-module
ModuleNotFoundError: No module named 'lutris

I don't really know anything about python except the few commands i found while searching for a solution, any help would be appreciated :)

edit: im running tumbleweed on the latest snapshot, but this issue has been present for at least a week.

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

🌐
YouTube
youtube.com › watch
No module named pkg_resources - YouTube
Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn--Music by Eric Matyashttps://www.soundimage.orgTrack title: Hypnotic...
Published: February 10, 2023
🌐
Site
sig-synopsys.my.site.com › community › s › article › Pip-Native-Inpsector-can-t-find-dependencies-with-error-pkg-resources-is-deprecated-as-an-API
Pip Native Inpsector can't find dependencies with error 'pkg_resources is deprecated as an API'
For Detect 9.x, PIP 23.1.2 is supported. Investigate further, the incompatibility was caused by the Deprecation of pkg_resources starting at Python 3.12, importlib.metadata is recommended starting from this version.
🌐
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 - C:\Users\User\Downloads\dnsReaper-1.10.0\dnsReaper-1.10.0>python main.py — help Traceback (most recent call last): File “C:\Users\User\Downloads\dnsReaper-1.10.0\dnsReaper-1.10.0\main.py”, line 5, in <module> import providers File “C:\Users\User\Downloads\dnsReaper-1.10.0\dnsReaper-1.10.0\providers\__init__.py”, line 9, in <module> from . import * File “C:\Users\User\Downloads\dnsReaper-1.10.0\dnsReaper-1.10.0\providers\googlecloud.py”, line 4, in <module> from google.cloud import dns File “C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\google\cloud\dns\__init__.py”, line 28, in <module> from pkg_resources import get_distribution ModuleNotFoundError: No module named ‘pkg_resources’ · Solution: Run below command solve the problem: pip install — upgrade setuptools ·
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › programming › python
import error:no module named pkg_resources - Raspberry Pi Forums
hello, I have meet a problem because of a wrong cmd i did. i have removed the pkg_resources and some other to with "autoremoved", so i have reinstall it with : sudo apt-get install pkg_ressources But, when i try to use pip: i have this message: File"/usr/local/bin/pip", line 5 in <module> from pkg_resources import load_entry_point ImportError: No module named pkg_resources I think pkg resources was install in a the wrong place ?
🌐
Arch Linux Forums
bbs.archlinux.org › viewtopic.php
[Solved] Python 3.9 pkg_resources not found / Newbie Corner / Arch Linux Forums
February 22, 2021 - >>> ipython Traceback (most recent call last): File "/home/user_id/.local/bin/ipython", line 6, in <module> from pkg_resources import load_entry_point ModuleNotFoundError: No module named 'pkg_resources' ... I installed ipython from arch repositories. I always try to install the general purpose modules directly on the system using pacman. For particular configurations I work in a virtual environment and I only use pip if a module is not available in arch repo.