Activate Virtual Environment Before Installing Pip Libs
Activating a virtual env usually fixes Most pip install errors
If that does not work look for your issue under!
Tip
- Try multiple fixes listed in the repository!
- Sometimes there's only one specific way to install the
pip-libyou're trying to get.
-
If Activate Virtual Environment did not work you can try these:
- ModuleNotFoundError
- ERROR: Could not install packages due to an EnvironmentError
- ERROR: Command errored out with exit status 1
- ERROR: pip is configured with locations that require TLS/SSL
- SSL Certificate Verification Error
- UnicodeDecodeError
- error: Microsoft Visual C++ 14.0 or greater is required
- pip freeze` not displaying packages
- break system packages error windows
-
If Activate Virtual Environment did not work you can try these:
- ModuleNotFoundError
- ERROR: Could not install packages due to an EnvironmentError
- ERROR: Command errored out with exit status 1
- ERROR: pip is configured with locations that require TLS/SSL
- SSL Certificate Verification Error
- UnicodeDecodeError
- `fatal error: Python.h: No such file or directory
- pip freeze not displaying packages
- break system packages error linux
Pip Tips โ 
-
Recommended to always Activate Virtual Environment before installing any pip libs!
- Upgrade pip
- Check pip version
- Install a package
- Install from requirements.txt
- Clear pip cache
- Resolve dependency conflicts
- List installed packages
- Freeze installed packages into a file
- Uninstall a package
- Allow breaking system packages
- Downgrade pip or packages
- Install from GitHub
- Check dependencies with pipdeptree
- Autoremove unused packages
python3 -m venv venv && source venv/bin/activatepython -m venv venv && .\venv\Scripts\activateEnsure you have the necessary permissions and correct Python version installed. On Linux/macOS, check the shell configuration:
chmod +x venv/bin/activate
source venv/bin/activateOn Windows:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSignedpython -m pip install --upgrade --force-reinstall <package_name>pip install --user <package_name>pip install --no-cache-dir <package_name>pip install <package_name> --trusted-host pypi.org --trusted-host files.pythonhosted.orgpip install <package_name> --trusted-host pypi.org --trusted-host files.pythonhosted.orgset PYTHONUTF8=1- Install Build Tools for Visual Studio.
Ensure you are in the correct virtual environment:
pip list
pip freeze > requirements.txtWhen encountering this error, explicitly allow breaking system packages:
pip install <package_name> --break-system-packagesIf upgrading causes compatibility issues:
pip install pip==<specific_version>pip install <package_name>==<specific_version>python3 -m pip install --upgrade --force-reinstall <package_name>pip install --user <package_name>pip install --no-cache-dir <package_name>pip install <package_name> --trusted-host pypi.org --trusted-host files.pythonhosted.orgpip install <package_name> --trusted-host pypi.org --trusted-host files.pythonhosted.orgexport PYTHONUTF8=1sudo apt-get install python3-dev # Ubuntu/Debian
sudo yum install python3-devel # CentOS/Red HatEnsure you are in the correct virtual environment:
pip list
pip freeze > requirements.txtWhen encountering this error, explicitly allow breaking system packages:
pip install <package_name> --break-system-packagespython3 -m pip install --upgrade pippip --versionpip install <package_name>pip install -r requirements.txtpip cache purgepip install <package_name> --use-deprecated=legacy-resolverpip listpip freeze > requirements.txtpip uninstall <package_name>pip install <package_name> --break-system-packagespip install pip==<specific_version>pip install <package_name>==<specific_version>Install a package directly from a GitHub repository:
pip install git+https://github.com/<user>/<repo>.gitGenerate a dependency tree to debug conflicts:
pip install pipdeptree
pipdeptreeClean up unused dependencies:
pip install pip-autoremove
pip-autoremove <package_name>Feel free to contribute or open an issue if new errors arise!


