Home > Article > Backend Development > Error: externally-managed-environment on python package installation
I attempted to install a Python package using this command.
pip3 install [package-name]
And then this error was thrown.
Create path/.config/pip/pip.conf and type this script.
[global] break-system-packages = true user = true
Install pipenv to manage dependencies per project. The pip.conf file let the command run with --break-system-packages and --user options.
pip3 install pipenv
Run a file with the all project dependencies in a virtual environment
pipenv run python [file-name] .py
Otherwise, you could run up a virtual environment instance and run the python file.
pipenv shell python [file-name].py
The above is the detailed content of Error: externally-managed-environment on python package installation. For more information, please follow other related articles on the PHP Chinese website!