
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-lib
you'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/activate
python -m venv venv && .\venv\Scripts\activate
Ensure 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/activate
On Windows:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
python -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.org
pip install <package_name> --trusted-host pypi.org --trusted-host files.pythonhosted.org
set PYTHONUTF8=1
- Install Build Tools for Visual Studio.
Ensure you are in the correct virtual environment:
pip list
pip freeze > requirements.txt
When encountering this error, explicitly allow breaking system packages:
pip install <package_name> --break-system-packages
If 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.org
pip install <package_name> --trusted-host pypi.org --trusted-host files.pythonhosted.org
export PYTHONUTF8=1
sudo apt-get install python3-dev # Ubuntu/Debian
sudo yum install python3-devel # CentOS/Red Hat
Ensure you are in the correct virtual environment:
pip list
pip freeze > requirements.txt
When encountering this error, explicitly allow breaking system packages:
pip install <package_name> --break-system-packages
python3 -m pip install --upgrade pip
pip --version
pip install <package_name>
pip install -r requirements.txt
pip cache purge
pip install <package_name> --use-deprecated=legacy-resolver
pip list
pip freeze > requirements.txt
pip uninstall <package_name>
pip install <package_name> --break-system-packages
pip 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>.git
Generate a dependency tree to debug conflicts:
pip install pipdeptree
pipdeptree
Clean up unused dependencies:
pip install pip-autoremove
pip-autoremove <package_name>
Feel free to contribute or open an issue if new errors arise!