pip3升级报错:PermissionError: [Errno 13] Permission denied: '/usr/bin/pip' -> '/tmp/pip-yndfk0h8-uninsta
pip3 install pip --upgrade报错PermissionError: [Errno 13] Permission denied:
来说一下关于pip3升级报错,下面是错误提示:
Exception:
Traceback (most recent call last):
File “/usr/lib/python3.6/shutil.py”, line 550, in move
os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: ‘/usr/bin/pip’ -> ‘/tmp/pip-yndfk0h8-uninstall/usr/bin/pip’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/local/lib/python3.6/dist-packages/pip-8.0.2-py3.6.egg/pip/basecommand.py”, line 209, in main
status = self.run(options, args)
File “/usr/local/lib/python3.6/dist-packages/pip-8.0.2-py3.6.egg/pip/commands/install.py”, line 317, in run
prefix=options.prefix_path,
File “/usr/local/lib/python3.6/dist-packages/pip-8.0.2-py3.6.egg/pip/req/req_set.py”, line 725, in install
requirement.uninstall(auto_confirm=True)
File “/usr/local/lib/python3.6/dist-packages/pip-8.0.2-py3.6.egg/pip/req/req_install.py”, line 752, in uninstall
paths_to_remove.remove(auto_confirm)
File “/usr/local/lib/python3.6/dist-packages/pip-8.0.2-py3.6.egg/pip/req/req_uninstall.py”, line 115, in remove
renames(path, new_path)
File “/usr/local/lib/python3.6/dist-packages/pip-8.0.2-py3.6.egg/pip/utils/init.py”, line 266, in renames
shutil.move(old, new)
File “/usr/lib/python3.6/shutil.py”, line 565, in move
os.unlink(src)
PermissionError: [Errno 13] Permission denied: ‘/usr/bin/pip’
解决方案
这种情况一般是没有足够的权限造成的,所以我们只需要给他权限!给他给他:
sudo pip3 install pip --upgrade
就可以啦