Python/Pip - Fix for error: externally-managed-environment

A command like this gives the externally managed error

pip install -r requirements.txt

Long story: Your distribution is trying to protect you against mixing apt provided packages and pip provided packages. Mixing two package managers (apt and pip here) is always a bad idea and the source of many issues.

Most likely python3 is installed by your OS package manager but you are trying to install dependencies with pip3 so you need to create a new virtual environment and install python3 in it to use

 

python3 -m venv /tmp/venv

source /tmp/venv/bin/activate

pip3 install -r requirements.txt



From bland to brand, get your business online
Website hosting and design by Dedicated to Servers, contact info@dedicatedtoservers.com

Click to send a quick inquiry

All rights Reserved © 2014-2024