If you are encountering the "error: externally-managed-environment" when trying to install or upgrade packages using pip, it means that your Python environment is being managed externally and you do not have permission to modify it. In this case, you will need to either gain the necessary permissions or use a virtual environment.
Here are two possible solutions:
- Gain necessary permissions:
- Run the pip command with administrative privileges by using
sudo
:sudo pip3 install package_name
- Run the pip command with administrative privileges by using