Python模块安装错误代码1

时间:2015-12-08 22:56:18

标签: python pip pyautogui

在过去的几天里,我一直试图通过pip安装pyautogui模块。它进展不顺利。我尝试过我在网上看到的一些修复,但都没有用。我需要一些帮助。这是我的CMD文本的副本:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\FrankFritz>py -m pip install pyautogui
Collecting pyautogui
  Using cached PyAutoGUI-0.9.31.zip
Collecting pymsgbox (from pyautogui)
  Using cached PyMsgBox-1.0.3.zip
Collecting PyTweening>=1.0.1 (from pyautogui)
  Using cached PyTweening-1.0.3.zip
Collecting Pillow (from pyautogui)
  Using cached Pillow-3.0.0-cp35-none-win_amd64.whl
Collecting pyscreeze (from pyautogui)
  Using cached PyScreeze-0.1.8.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "C:\Users\FrankFritz\AppData\Local\Temp\pip-build-yjly5zdh\pyscreeze\setup.p
y", line 6, in <module>
        version=__import__('pyscreeze').__version__,
      File "C:\Users\FrankFritz\AppData\Local\Temp\pip-build-yjly5zdh\pyscreeze\pyscree
ze\__init__.py", line 21, in <module>
        from PIL import Image
    ImportError: No module named 'PIL'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\FrankFritz\AppD
ata\Local\Temp\pip-build-yjly5zdh\pyscreeze

提前谢谢你,一直非常令人沮丧。

3 个答案:

答案 0 :(得分:2)

首先安装PIL。如果您正在使用Py3,请安装PillowPIL替代。

答案 1 :(得分:2)

按win键+ R然后键入cmd

在命令提示符下输入

cd xx/pythonxx/scripts #xx表示您的python目录,例如C:/python34/script

pip install pillow#for python 3xx版本

pip install pil#for python 2xx版本

pip install pyautogui#这应该现在可以使用

答案 2 :(得分:0)

我在Windows 7上尝试为Python 3.4安装pyautogui时遇到了同样的问题。最后通过执行以下操作设法使其工作:

easy_install.exe Pillow
pip install pyautogui

希望这也有助于其他人。