【发布时间】:2022-12-17 14:02:13
【问题描述】:
通过执行pip install --upgrade pip,我得到以下信息:
Collecting pip
Using cached https://files.pythonhosted.org/packages/27/79/8a850fe3496446ff0d584327ae44e7500daf6764ca1a382d2d02789accf7/pip-20.3.4-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 18.1
Uninstalling pip-18.1:
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip-18.1.dist-info/INSTALLER'
Consider using the `--user` option or check the permissions.
You are using pip version 18.1, however version 20.3.4 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
【问题讨论】:
-
您是否考虑过使用
--user选项或检查该文件夹的权限? -
你为什么要搞乱 Mac 上的系统 Python?您应该使用另一个 Python 安装,而不要管那个
-
请改用
pip3。 -
回应上面的一些 cmets:不要使用系统文件(即不要升级系统 pip;让 Apple 处理,尽管他们可能不会),并安装更新的 Python 3 版本并工作接着就,随即。自 2021 年 1 月以来,Pip 也不再支持 Python 2.7。
-
@enthusiast 出于上述 cmets 中提到的原因,最好不要在这种情况下。