報錯
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.
If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.
See /usr/share/doc/python3.11/README.venv for more information.
note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
文章來源:http://www.zghlxwxcb.cn/news/detail-721951.html
解決
按照提示,需使用虛擬環(huán)境方可正常使用pip install相關(guān)命令,應(yīng)該是python版本升級之后在linux環(huán)境將這點作為了必選項。文章來源地址http://www.zghlxwxcb.cn/news/detail-721951.html
python3 -m venv myvenv
到了這里,關(guān)于解決python 3.11版本在linux ubuntu 23.04上使用pip命令報錯:error: externally-managed-environment的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!