PIP - 升级不起作用Python3.4.4

时间:2016-03-22 21:58:00

标签: python pip python-3.4

我已经看了很多关于此的帖子,似乎没有什么能解决它。我最初开始使用Python 3.5,听说pip有几个未解决的问题,所以我卸载并重新安装了Python 3.4.4 -

我想将pyautogui用于工作任务,但是当我尝试在Python3.4.4安装后直接安装pyautogui时,它告诉我PIL模块无法找到。我在另一篇文章中读到安装3.4.4并更新pip,然后安装pyautogui。很酷,所以我安装了3.4.4,我需要升级pip。所以我进入了

Scripts\pip.exe install --upgrade pip

从根文件夹中的命令行。每次我得到这个

 Exception:
Traceback (most recent call last):
  File "h:\python34\lib\shutil.py", line 527, in move
    os.rename(src, real_dst)
PermissionError: [WinError 32] The process cannot access the file because it is
being used by another process: 'h:\\python34\\scripts\\pip.exe' -> 'C:\\Users\\z
jf\\AppData\\Local\\Temp\\pip-qo75adq9-uninstall\\python34\\scripts\\pip.exe'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "h:\python34\lib\site-packages\pip\basecommand.py", line 211, in main
  File "h:\python34\lib\site-packages\pip\commands\install.py", line 311, in run

  File "h:\python34\lib\site-packages\pip\req\req_set.py", line 640, in install
  File "h:\python34\lib\site-packages\pip\req\req_install.py", line 716, in unin
stall
  File "h:\python34\lib\site-packages\pip\req\req_uninstall.py", line 125, in re
move
  File "h:\python34\lib\site-packages\pip\utils\__init__.py", line 315, in renam
es
  File "h:\python34\lib\shutil.py", line 540, in move
    os.unlink(src)
PermissionError: [WinError 32] The process cannot access the file because it is
being used by another process: 'h:\\python34\\scripts\\pip.exe'

事情是,该文件夹中没有任何内容正在运行。我没有Windows资源管理器打开它,我没有任何东西访问那里的任何文件,我显然使用命令行从上层目录运行它。所以我不知道为什么它说pip.exe被另一个进程使用。它运行的唯一过程本身就是问题,那么你应该如何升级它?

**编辑:**根据接受的答案,为了让PIP更新,我使用了命令

python -m pip install -U pip

一旦有效,我又尝试再次安装pyautogui。它仍然说无法找到PIL模块。 PIL是Python图像库。我用

安装了它

python -m pip install image

一旦有效,我就像这样安装pyautogui

python -m pip install pyautogui

2 个答案:

答案 0 :(得分:4)

要在Windows上升级pip google“在Windows上升级点”,或者在命令提示符中交替运行:

python -m pip install -U pip

这是Windows上的一个已知问题,其中可执行文件在运行时无法覆盖。对不起,没有方便的链接,但应该很容易找到更多的细节。

答案 1 :(得分:0)

问题:您正在使用pip版本18.1,但是可以使用版本19.0.1。您应该考虑通过“ python -m pip install –upgrade pip”命令进行升级。

解决方案:要在Windows中升级PIP,您需要打开Windows命令提示符,然后在下方键入/复制命令。请注意,仅当您已经将Python添加到Windows路径时,以下方法才有效。如果您不知道这是什么意思,请不要担心,因为下一节将在Windows中显示升级点子的完整步骤。

python -m pip install --upgrade pip