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
以上是錯誤:python 套件安裝時的外部管理環境的詳細內容。更多資訊請關注PHP中文網其他相關文章!