【问题标题】:Python Module Installation Error Code 1Python模块安装错误代码1
【发布时间】:2016-03-14 01:38:40
【问题描述】:

在过去的几天里,我一直在尝试通过 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

提前谢谢你,这很令人沮丧。

【问题讨论】:

  • 报错告诉你需要安装PIL

标签: python pip pyautogui


【解决方案1】:

首先安装PIL。如果您使用的是 Py3,请安装 Pillow,一个 PIL 替代品。

【讨论】:

    【解决方案2】:

    按win键+R然后输入cmd

    在命令提示符下输入:

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

    pip install pillow # 适用于 python 3xx 版本

    pip install pil # 适用于 python 2xx 版本

    pip install pyautogui # 现在应该可以工作了

    【讨论】:

      【解决方案3】:

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

      easy_install.exe Pillow
      pip install pyautogui
      

      希望这对其他人也有帮助。

      【讨论】:

        猜你喜欢
        • 2019-03-08
        • 1970-01-01
        • 1970-01-01
        • 2015-11-27
        • 1970-01-01
        • 2015-10-07
        • 1970-01-01
        • 1970-01-01
        • 2012-09-02
        相关资源
        最近更新 更多