首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >你知道怎么在windows机器上更新python PIP吗?

你知道怎么在windows机器上更新python PIP吗?
EN

Stack Overflow用户
提问于 2010-12-08 02:02:36
回答 5查看 77.9K关注 0票数 57

pip install --upgrade pip无法工作,因为windows FS是大脑受损的,不让你删除一个打开的文件。

我尝试将我的环境设置为我想要更新的virtualenv,然后从不同的pip运行,但失败了,错误为:

代码语言:javascript
复制
(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上没有问题...

EN

回答 5

Stack Overflow用户

回答已采纳

发布于 2010-12-08 02:05:55

easy_install -U pip

:-)

票数 119
EN

Stack Overflow用户

发布于 2015-02-20 05:14:05

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

代码语言:javascript
复制
python -m pip install -U pip
票数 66
EN

Stack Overflow用户

发布于 2018-07-13 04:14:30

尝试:

右键单击Anaconda提示符(以管理员身份运行)

代码语言:javascript
复制
>> conda update pip

(如果您使用的是Anaconda。附言:这对我很有效)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4379970

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档