红联Linux门户
Linux帮助

ubuntu16.04下更新pip

发布时间:2016-12-11 09:52:27来源:linux网站作者:WxyangID
在ubuntu 16.04下更新pip使用:sudo python -m pip install –upgrade pip 命令。
 
使用pip install –upgrade pip 总是报错:
Uninstalling pip-7.1.0:
Exception:
Traceback (most recent call last):
File “/usr/lib/python3.5/shutil.py”, line 538, in move
os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: ‘/usr/local/lib/python3.5/dist-packages/pip-7.1.0-py3.5.egg’ -> ‘/tmp/pip-whm8ys6u-uninstall/usr/local/lib/python3.5/dist-packages/pip-7.1.0-py3.5.egg’
 
尝试用如下命令进行更新pip成功解决了以上的问题:
sudo python -m pip install –upgrade pip
The directory ‘/home/wang/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
You are using pip version 7.1.0, however version 9.0.1 is available.
You should consider upgrading via the ‘pip install –upgrade pip’ command.
The directory ‘/home/wang/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
Collecting pip
Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
100% |█████████████████████████████████| 1.3MB 127kB/s
Installing collected packages: pip
Found existing installation: pip 7.1.0
Uninstalling pip-7.1.0:
Successfully uninstalled pip-7.1.0
Successfully installed pip-9.0.1
 
本文永久更新地址:http://www.linuxdiyf.com/linux/26795.html