pip安装出现问题 OSError: [Errno 13] Permission denied: '/usr/bin/pip'

[xiaokang@localhost ~]$ pip install --upgrade pip
Cache entry deserialization failed, entry ignored
Collecting pip
  Downloading https://pypi.doubanio.com/packages/62/ca/94d32a6516ed197a491d17d46595ce58a83cbb2fca280414e57cd86b84dc/pip-19.2.1-py2.py3-none-any.whl (1.4MB)
 ...................................
File "/usr/lib/python2.7/site-packages/pip/req/req_install.py", line 742, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/usr/lib/python2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/usr/lib/python2.7/site-packages/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/usr/lib64/python2.7/shutil.py", line 302, in move
    os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/bin/pip'
You are using pip version 8.1.2, however version 19.2.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

根据提示:

                  OSError: [Errno 13] Permission denied: '/usr/bin/pip'

 说明权限被拒绝,需要提权操作

[xiaokang@localhost ~]$ sudo pip install --upgrade pip  # sudo提权
Cache entry deserialization failed, entry ignored
Collecting pip
   .......................................
Installing collected packages: pip
  Found existing installation: pip 8.1.2
    Uninstalling pip-8.1.2:
      Successfully uninstalled pip-8.1.2
Successfully installed pip-19.2.1

 

你可能感兴趣的:(知识点杂记,代码出错问题解决)