[英]Upgrade Pip error message
当我跑
pip install --upgrade pip
我收到此错误消息:
Collecting pip
Downloading pip-8.1.0-py2.py3-none-any.whl (1.2MB)
100% |████████████████████████████████| 1.2MB 371kB/s
Installing collected packages: pip
Found existing installation: pip 8.0.2
Uninstalling pip-8.0.2:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 725, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 752, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py",line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 266, in renames
shutil.move(old, new)
File"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 303, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site- packages/pip-8.0.2.dist-info/DESCRIPTION.rst'
以前我一直在努力安装和运行几个 python 模块,所以我记得稍微移动了一些文件。 这是导致此错误的原因吗? 我怎样才能解决这个问题? 我在 Mac 上。
在此之前,我试图安装 bs4,但收到了类似的错误消息。 (但我怀疑 bs4 安装有更多问题,所以这是以后的另一个问题)。
也很抱歉代码的任何格式问题。 已尽力使它看起来像在终端上。
谢谢。
在管理员模式命令提示符下,您可以运行以下命令,这应该可以解决问题:
python -m ensurepip --user
如果您的版本支持,请替换 python3。
最好的方法如下:
$ python3 -m pip install --upgrade pip
因为一般不建议使用
$ sudo pip install
更多答案可以在这里找到: https : //github.com/pypa/pip/issues/5599
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirement.txt'
WARNING: You are using pip version 19.2.3, however version 20.3.4 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
$ pip install pip
Requirement already satisfied: pip in /data/data/com.termux/files/usr/lib/python3.9/site-packages (21.0.1)
显示这样的帮助!!!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.