簡體   English   中英

Python模塊安裝錯誤代碼1

[英]Python Module Installation Error Code 1

在過去的幾天里,我一直在嘗試通過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 如果您使用的是Py3,請安裝PillowPIL替代品)。

按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 #現在應該可以工作了

我在嘗試在Windows 7上為Python 3.4安裝pyautogui遇到了相同的問題。最后通過執行以下操作設法使其正常工作:

easy_install.exe Pillow
pip install pyautogui

希望這對其他人也有幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM