pip install --upgrade pip 不起作用,因为windows FS是大脑受损的和不会让你删除一个开放的文件。

我已经试过我设置的环境,以在虚拟环境下,我想要更新,然后从运行一个不同点,但这一失败:

(jm) E:\python\jm>c:\Python26\Scripts\pip install --upgrade pip
Downloading/unpacking pip
  Running setup.py egg_info for package pip
    warning: no previously-included files matching '*.txt' found under directory 'docs\_build'
    no previously-included directories found matching 'docs\_build\_sources'
Installing collected packages: pip
  Found existing installation: pip 0.7.1
    Uninstalling pip:
      Successfully uninstalled pip
  Running setup.py install for pip
    warning: no previously-included files matching '*.txt' found under directory 'docs\_build'
    no previously-included directories found matching 'docs\_build\_sources'
    Installing pip-script.py script to c:\Python26\Scripts
    Installing pip.exe script to c:\Python26\Scripts
    Installing pip.exe.manifest script to c:\Python26\Scripts
    Installing pip-2.6-script.py script to c:\Python26\Scripts
    Installing pip-2.6.exe script to c:\Python26\Scripts
    Installing pip-2.6.exe.manifest script to c:\Python26\Scripts
Exception:
Traceback (most recent call last):
  File "c:\Python26\lib\site-packages\pip-0.7.1-py2.6.egg\pip\basecommand.py", line 120, in main
  File "c:\Python26\lib\site-packages\pip-0.7.1-py2.6.egg\pip\commands\install.py", line 165, in run
  File "c:\Python26\lib\site-packages\pip-0.7.1-py2.6.egg\pip\req.py", line 1251, in install
  File "c:\Python26\lib\site-packages\pip-0.7.1-py2.6.egg\pip\req.py", line 466, in commit_uninstall
  File "c:\Python26\lib\site-packages\pip-0.7.1-py2.6.egg\pip\req.py", line 1549, in commit
  File "c:\Python26\lib\shutil.py", line 216, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "c:\Python26\lib\shutil.py", line 216, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "c:\Python26\lib\shutil.py", line 221, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "c:\Python26\lib\shutil.py", line 219, in rmtree
    os.remove(fullname)
WindowsError: [Error 5] Access is denied: 'c:\\users\\mark\\appdata\\local\\temp\\pip-gvsove-uninstall\\python26\\scripts\\pip.exe'

Storing complete log in C:\Users\mark\AppData\Roaming\pip\pip.log

(jm) E:\python\jm>dir c:\Users\mark\AppData\Local\temp\pip-gvsove-uninstall\python26\scripts
 Volume in drive C has no label.
 Volume Serial Number is 74E4-FE9F

 Directory of c:\Users\mark\AppData\Local\temp\pip-gvsove-uninstall\python26\scripts

12/07/2010  11:32 AM    <DIR>          .
12/07/2010  11:32 AM    <DIR>          ..
05/14/2010  05:54 PM             7,168 pip.exe
               1 File(s)          7,168 bytes
               2 Dir(s)  22,824,603,648 bytes free

(jm) E:\python\jm>del c:\Users\mark\AppData\Local\temp\pip-gvsove-uninstall\python26\scripts\pip.exe

我希望其他人已经想出一个办法解决这个问题。它没有问题上linux。...

有帮助吗?

解决方案

easy_install -U pip

:-)

其他提示

将PIP作为脚本运行,使用Python作为主要可执行文件。

python -m pip install -U pip

[更新2015-11-15]此后已经过时和失日期。当前最佳做法 根据pip 是使用如下:

python -m pip install -U pip setuptools

这是不必要的使用 easy_install设置工具.建议的程序来更新pip,从 pip-安装 页面是用 get-pip.py.

安装或 升级 pip、安全地下载 get-pip.py.

你可以用下面的一个 Bash 喜欢 msysgit文件Bash.

user@machine ~$ curl -L https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py | python

使用 -L 选择执行重定向。最近审查改变的url原的内容,所以 老原 get-pip.py url重定向 和上的画中画的网站 url改变.如果成功的话,你应该看到如下:

$ curl -L https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py | python
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1309k  100 1309k    0     0   364k      0  0:00:03  0:00:03 --:--:--  366k
Downloading/unpacking pip from https://pypi.python.org/packages/py2.py3/p/pip/pip-1.5.6-py2.py3-none-any.whl#md5=4d4fb4b69df6731c7aeaadd6300bc1f2
Installing collected packages: pip
  Found existing installation: pip 1.5.4
    Uninstalling pip:
      Successfully uninstalled pip
Successfully installed pip
Cleaning up...

你可以修改这一为Windows命令行,但首先如果你没有libcurl, 下载Windows二进制从卷曲.你要一路滚动到底,并得到 Günter可耐福当前的官方Win32binary(目前7.29) 和解。不要担心它是32位与64位。只要确保你得到一个与所有的花里胡哨的(ssl,zlib,等等)。现在航行到文件夹里你下载的卷曲,很可能 c:\Users\<you>\Downloads, 打开中提取的文件夹,可能是 curl-7.29.0-rtmp-ssh2-ssl-sspi-zlib-idn-static-bin-w32, ,你应该找到 curl.exe.耶!现在,在一个窗户壳类今后的提示(这将有你的用户名,而不是的 myusername),替换 path\to\Curl\ 带路下载的 curl.exe 文件。

C:\Users\myusername> path\to\Curl\curl.exe -kL https://bootstrap.pypa.io/get-pip.py | python

你需要的 -k 选项,以允许卷曲的访问的安全。pip的网站没有证书.还有,谢谢 彼得*Dobrogost 告诉我关于Windows的管道, |, ,从而节省的步骤保存的文件。

如果你已经有了最新版的画中画,你会得到下列信息:

$ curl https://bootstrap.pypa.io/get-pip.py | python
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1309k  100 1309k    0     0   369k      0  0:00:03  0:00:03 --:--:--  371k
Requirement already up-to-date: pip in c:\python27\lib\site-packages
Cleaning up...

还工作只是现在virtualenvs.

尝试:
右键单击Anaconda提示(作为管理员运行)

>> conda update pip

(如果您使用的是Anaconda。PS:它对我有用)

pip install pip --upgrade

enter image description here 为我工作

注意:确保在管理员模式下运行命令提示符

嘿,我只能在python 36上使用CMD中的以下命令升级PIP

Python -M PIP安装 - 升级PIP

CMD : Upgrading PIP in Python 36

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top