pkg_resources is a dependency of setuptools. Open the terminal and type:

sudo apt install --reinstall python3-pkg-resources python3-setuptools
Answer from karel on askubuntu.com
🌐
GitHub
github.com › Nerogar › OneTrainer › issues › 1304
[Bug]: Modern versions of setuptools no longer bundle pkg_resources · Issue #1304 · Nerogar/OneTrainer
February 10, 2026 - Traceback (most recent call last): File "/home/redacted/onetrainer-old/OneTrainer/venv/bin/tensorboard", line 3, in <module> from tensorboard.main import run_main File "/home/redacted/onetrainer-old/OneTrainer/venv/lib/python3.12/site-packages/tensorboard/main.py", line 27, in <module> from tensorboard import default File "/home/redacted/onetrainer-old/OneTrainer/venv/lib/python3.12/site-packages/tensorboard/default.py", line 30, in <module> import pkg_resources ModuleNotFoundError: No module named 'pkg_resources'
Author: Nerogar
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
python - No module named pkg_resources - Stack Overflow
I'm deploying a Django app to a dev server and am hitting this error when I run pip install -r requirements.txt: Traceback (most recent call last): File "/var/www/mydir/virtualenvs/dev/bin/pip& More on stackoverflow.com
🌐 stackoverflow.com
Why module pkg_resources is not found
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 ... More on discuss.python.org
🌐 discuss.python.org
1
0
November 22, 2024
ModuleNotFoundError: No module named 'pkg_resources' - Development - PyMC Discourse
Apologies if this is not the right forum for this. But I am working on porting the Statistical Rethinking (2nd Edition) notebooks to PyMC v5+ (and Pytensor). My PR can be found here: The pre-commit checks run successfully on my local machine, but on github I get an error on the black, isort, ... More on discourse.pymc.io
🌐 discourse.pymc.io
0
January 7, 2024
🌐
GitHub
github.com › tensorflow › tensorboard › issues › 7003
Deprecated pkg_resources package · Issue #7003 · tensorflow/tensorboard
June 24, 2025 - my_env_path/lib/python3.12/sit... https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30....
Author: tensorflow
🌐
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.

🌐
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.
🌐
Arch Linux Forums
bbs.archlinux.org › viewtopic.php
[Solved] tensorboard: A python package with a python2 dependency / Newbie Corner / Arch Linux Forums
October 27, 2017 - $ tensorboard Traceback (most recent call last): File "/usr/bin/tensorboard", line 6, in <module> from pkg_resources import load_entry_point File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3049, in <module> @_call_aside File "/usr/lib/python3.6/site-packages/pkg_res...
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

🌐
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 ......
Find elsewhere
🌐
PyMC Discourse
discourse.pymc.io › development
ModuleNotFoundError: No module named 'pkg_resources' - Development - PyMC Discourse
January 7, 2024 - Apologies if this is not the right forum for this. But I am working on porting the Statistical Rethinking (2nd Edition) notebooks to PyMC v5+ (and Pytensor). My PR can be found here: The pre-commit checks run successfully on my local machine, but on github I get an error on the black, isort, ...
🌐
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.
🌐
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?

🌐
sqlpey
sqlpey.com › python › solved-how-to-fix-no-module-named-pkgresources
Solved: How to Fix 'No Module Named pkg_resources' in Your Python Environment
December 5, 2024 - sudo apt-get install --reinstall python3-pkg-resources · If you’ve recently updated Python, it can help to reinstall setuptools entirely: sudo apt-get install python-setuptools python-dev build-essential · If you’re using poetry, add setuptools as a development dependency and install it using: poetry add --dev setuptools poetry run pip install setuptools · Check for naming conflicts in your project’s directory (e.g., a folder named “site” could interfere with package discovery).
🌐
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' ```
🌐
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 named 'pkg_resources' occurs in Python when the setuptools module can’t be found.
🌐
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”.
🌐
Bobby Hadz
bobbyhadz.com › blog › python-no-module-named-pkg-resources
No module named 'pkg_resources' in Python [Solved] | bobbyhadz
The error "No module named 'pkg_resources'" occurs when you don't have the setuptools package installed.
🌐
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.
🌐
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...
🌐
Unreal Engine
forums.unrealengine.com › development › pipeline & plugins
Failed to Load TensorBoard: No module named 'tensorboard' [LearningAgents] - Pipeline & Plugins - Epic Developer Community Forums
July 10, 2024 - So I’ve been integrating the Learning Agents Plugin into my game project, and so far, so good, the plugin is pretty much ready for training, except for one thing: I can’t seem to get TensorBoard to run. Everything else runs: it does go through a training process, I get the appropriate logs ...