mac使用homebrew更新了python3.12,删除了以前的版本和pip3安装软件时候报错。
error: externally-managed-environment
× this environment is externally managed
╰─> to install python packages system-wide, try brew install
xyz, where xyz is the package you are trying to
install.
if you wish to install a non-brew-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.
if you wish to install a non-brew 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.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.
看了很多人说要删除externally-managed这个文件。
在mac系统里,这个文件藏在这里,删除即可。
/usr/local/cellar/python@3.12/3.12.3/frameworks/python.framework/versions/3.12/lib/python3.12
到此这篇关于mac更新python3.12 解决pip3安装报错的文章就介绍到这了,更多相关python3.12 解决pip3安装报错内容请搜索代码网以前的文章或继续浏览下面的相关文章希望大家以后多多支持代码网!
发表评论