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

🌐
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 - 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 behavior: Install Python 3.12.4 Install Chang...
Discussions

[Bug] setup.py raises `ModuleNotFoundError: No module named 'pkg_resources'` after release of setuptools 82.0
Prerequisite I have searched Issues and Discussions but cannot get the expected help. The bug has not been fixed in the latest version(https://github.com/open-mmlab/mmcv). Environment pip install s... More on github.com
🌐 github.com
February 9, 2026
Bench new-site throws Error: No module named ‘pkg_resources’
Hi, On a new install (Ubuntu 22.04, ... Dropbox Settings, the DocType you’re trying to open might be deleted. Error: No module named ‘pkg_resources’ I’ve tried reinstalling setuptools several times but doesn’t seem to solve the issue Is this a bug ? Any ideas how to ... More on discuss.frappe.io
🌐 discuss.frappe.io
19
1
February 9, 2026
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
No module named 'pkg_resources' error while building love game
You'd be better off posting this as an issue in the makelove repository, if there is one More on reddit.com
🌐 r/love2d
3
1
June 11, 2024
🌐
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 ... it is there), I thought that an error occurred and deleted setuptools pip uninstall setuptools and then downloaded ......
🌐
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 - ... When environments install the latest Setuptools, the module is no longer present, resulting in the error. If your project or dependencies still rely on pkg_resources, install a Setuptools version below 82.
🌐
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 - As a result, any fresh Frappe v15 install fails with ModuleNotFoundError: No module named 'pkg_resources'. Frappe v16 is not affected because the dropbox dependency was moved to offsite_backups and updated to 12.0.2 · There is an existing issue tracking this: https://github.com/frappe/bench/issues/1698 · And an open PR that fixes it by capping setuptools to <82.0.0: https://github.com/frappe/bench/pull/1699
🌐
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 - The pkg_resources module belongs to the setuptools package and allows access to resource files and discovery of extensions. However, this module is not recommended and has been marked as deprecated; instead, importlib.resources and ...
🌐
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
🌐
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. ... To fix this error, running the command, pip install --upgrade setuptools , will allow you to finish ...
🌐
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?

🌐
Bobby Hadz
bobbyhadz.com › blog › python-no-module-named-pkg-resources
No module named 'pkg_resources' in Python [Solved] | bobbyhadz
The Python No module named 'pkg_resources' occurs when `setuptools` is not installed in our Python environment.
🌐
GitHub
github.com › pypa › setuptools › issues › 4374
[BUG] No module named 'pkg_resources.extern' · Issue #4374 · pypa/setuptools
May 21, 2024 - python -m pip install -U setuptools pip install -U pyarmor==7.* pyinstaller[encryption]==4.* pyarmor pack main.py · 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'
Author: pypa
🌐
Stack Overflow
stackoverflow.com › questions › 60517694 › no-module-named-pkg-resources-when-installing-setuptools-in-python
No module named 'pkg_resources' when installing setuptools in Python
I tried many of them, but whenever I tried to install python-pkg-resources or setuptools I get the same error message of No module named 'pkg_resources'
🌐
Moon Technolabs
moontechnolabs.com › qanda › modulenotfounderror-pkg-resources
How to Fix ModuleNotFoundError: 'pkg_resources' Error?
July 22, 2026 - The ModuleNotFoundError: No module named ‘pkg_resources’ error is usually caused by a missing or corrupted setuptools installation, an incorrect Python interpreter, or a broken virtual environment.
🌐
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. I believe pkg_resources should continue to be installed in the environment legacy configuration. Whether this "installation" is handled by pip or setuptools is likely an implementation detail, but in either case the backing code to support it is small, and it could easily be filed away somewhere and never looked at again.
🌐
Itsourcecode
itsourcecode.com › home › [solved 2026] modulenotfounderror: no module named ‘pkg_resources’ fix
[Solved 2026] ModuleNotFoundError: No module named 'pkg_resources' Fix
July 12, 2026 - Fix Python "ModuleNotFoundError: No module named 'pkg_resources'" by installing setuptools: pip install setuptools. 2026 fix.
🌐
sebhastian
sebhastian.com › python-no-module-named-pkg-resources
Fix Python ModuleNotFoundError: No module named 'pkg_resources' | sebhastian
January 27, 2023 - The ModuleNotFoundError: No module ... you’re running. To fix this error, you need to ensure that you have the latest version of setuptools package installed on your system....
🌐
GitHub
github.com › openai › CLIP › issues › 528
Build fails with setuptools 81+ due to pkg_resources removal · Issue #528 · openai/CLIP
February 9, 2026 - Description Problem CLIP fails to build with setuptools 82+ because setup.py imports pkg_resources, which was removed in setuptools 81 (08 Feb 2026). ModuleNotFoundError: No module named 'pkg_r...
🌐
Meltano
discuss.meltano.com › t › 33076806 › hmm-this-seems-to-no-longer-be-helping-the-pkg-resources-pac
Hmm this seems to no longer be helping The pkg resources pac Meltano #announcements
February 13, 2026 - The pkg_resources package seems to now have been completely removed from the setuptools repository, so even if forcing its use, it can't be downloaded and so the build of the plugin fails at install time (I'm trying target-s3).
🌐
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 ·