Loading...
Loading...
ModuleNotFoundError: No module named 'pkg_resources'`pkg_resources` is part of the `setuptools` package. This error often happens in modern Python environments because `pkg_resources` was deprecated and removed from some default installations, or `setuptools` is missing entirely. It is extremely common when installing AI tools like Stable Diffusion (Automatic1111) or running older `setup.py` scripts.
90% of the time, you just need to install setuptools explicitly.
pip install setuptools
# If that doesn't work, try upgrading:
pip install --upgrade setuptoolsSome older AI repos (like old Stable Diffusion versions) rely on APIs removed in setuptools v70+. Downgrading helps.
pip install "setuptools<70"If pip is broken, the cleanest fix is to nuke the venv and start over.
# Delete the venv folder
rm -rf venv/
# Recreate it
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
# Reinstall requirements
pip install -r requirements.txtFix this error faster with our free tool