我无法获得最新版本的pip

时间:2017-06-26 21:46:07

标签: python pip

当我尝试使用命令提示符升级我的点,到最新版本时,我得到下图中的错误。是否有一个我忽略的行政步骤?

我的命令提示符的图像位于此链接(我没有包含图像所需的10的声誉)。 enter image description here

C:\Users\hassa>python -m pip install --upgrade pip
Collecting pip
  Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
    100% |################################| 1.3MB 455kB/s

Installing collected packages: pip
  Found existing installation: pip 8.1.2
    Uninstalling pip-8.1.2:

Exception:

Traceback (most recent call last):
  File "C:\Program Files\Anaconda3\lib\shutil.py", line 538, in move
    os.rename(src, real_dst)

PermissionError: [WinError 5] Access is denied: 'c:\\program files\\anaconda3\\lib\\site-packages\\pip' -> 'C:\\Users\\hassa\\AppData\\Local\\Temp\\pip-uazegy0h-uninstall\\program files\\anaconda3\\lib\\site-packages\\pip'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\Anaconda3\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)

  File "C:\Program Files\Anaconda3\lib\site-packages\pip\commands\install.py", line 317, in run
    prefix=options.prefix_path,

  File "C:\Program Files\Anaconda3\lib\site-packages\pip\req\req_set.py", line 736, in install
    requirement.uninstall(auto_confirm=True)

  File "C:\Program Files\Anaconda3\lib\site-packages\pip\req\req_install.py", line 742, in uninstall
    paths_to_remove.remove(auto_confirm)

  File "C:\Program Files\Anaconda3\lib\site-packages\pip\req\req_uninstall.py", line 115, in remove
    renames(path, new_path)

  File "C:\Program Files\Anaconda3\lib\site-packages\pip\utils\__init__.py", line 267, in renames
    shutil.move(old, new)

  File "C:\Program Files\Anaconda3\lib\shutil.py", line 550, in move
    rmtree(src)

  File "C:\Program Files\Anaconda3\lib\shutil.py", line 488, in rmtree
    return _rmtree_unsafe(path, onerror)

  File "C:\Program Files\Anaconda3\lib\shutil.py", line 383, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())

  File "C:\Program Files\Anaconda3\lib\shutil.py", line 381, in _rmtree_unsafe
    os.unlink(fullname)
PermissionError: [WinError 5] Access is denied: 'c:\\program files\\anaconda3\\lib\\site-packages\\pip\\basecommand.py'

You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

C:\Users\hassa>
____________________________________

1 个答案:

答案 0 :(得分:1)

看来你正在使用Anaconda。在这种情况下,您应该使用conda命令更新pip:

conda update pip

如果不起作用,请尝试以管理员身份打开cmd.exe,然后重试。