PyCharm не распознает pyauto gui. Попытка установить его в PyCharm выдает «Ошибка при установке пакета« pyauto gui »» - PullRequest
0 голосов
/ 17 марта 2020

Я пытаюсь написать скрипт, имитирующий щелчки мыши, используя pyauto gui lib. Моя проблема в том, что я не могу заставить PyCharm узнать, что он был установлен через CMD. Вот мой быстрый отрывок из библиотеки:

import pyautogui as pg # No module named pyautogui error

Я попытался удалить и переустановить pyauto gui с повышенным CMD и получить следующее:

PS C:\Users\xxx\AppData\Local\Programs\Python\Python38-32\Scripts> pip install pyautogui
Collecting pyautogui
  Using cached https://files.pythonhosted.org/packages/1c/3c/4711a718371f6a16fd19833abf5feea2b1701722bcecdba782d5db7a9f36/PyAutoGUI-0.9.48.tar.gz

...

Installing collected packages: pyautogui
  Running setup.py install for pyautogui ... done
Successfully installed pyautogui-0.9.48

Нет ошибок , но все еще не работает в PyCharm. Затем я попытался установить пакет из самого PyCharm, поскольку иногда читаю, что помогает, и получаю следующее:

Collecting PyAutoGUI
  Using cached https://files.pythonhosted.org/packages/1c/3c/4711a718371f6a16fd19833abf5feea2b1701722bcecdba782d5db7a9f36/PyAutoGUI-0.9.48.tar.gz
Requirement already satisfied: pymsgbox in c:\users\redacted\venv\lib\site-packages (from PyAutoGUI) (1.0.7)
Requirement already satisfied: PyTweening>=1.0.1 in c:\users\redacted\venv\lib\site-packages (from PyAutoGUI) (1.0.3)
Collecting pyscreeze>=0.1.21 (from PyAutoGUI)
  Using cached https://files.pythonhosted.org/packages/b7/7d/a0e85da28a96e2ff2f39e682ff84eb92501b564883fde87d92aee29966a2/PyScreeze-0.1.26.tar.gz
Collecting pygetwindow>=0.0.5 (from PyAutoGUI)
  Using cached https://files.pythonhosted.org/packages/28/8b/f1a396f8ec5923e11246fabe29419a6dd8949a0360337fe6ad0f28a9c33b/PyGetWindow-0.0.8.tar.gz
Collecting mouseinfo (from PyAutoGUI)
  Using cached https://files.pythonhosted.org/packages/cc/dd/dd184693becfcf4fe3eda41462b791687fd4b1d314f53b387a72d88ba08d/MouseInfo-0.1.2.tar.gz
Collecting Pillow>=6.2.1 (from pyscreeze>=0.1.21->PyAutoGUI)
  Using cached https://files.pythonhosted.org/packages/39/47/f28067b187dd664d205f75b07dcc6e0e95703e134008a14814827eebcaab/Pillow-7.0.0.tar.gz
Collecting pyrect (from pygetwindow>=0.0.5->PyAutoGUI)
  Using cached https://files.pythonhosted.org/packages/2f/68/bd7bf96fc44217e769f27912e6c9bb3e9987cba286054af6120448ce8212/PyRect-0.1.4.tar.gz
Collecting pyperclip (from mouseinfo->PyAutoGUI)
  Using cached https://files.pythonhosted.org/packages/2d/0f/4eda562dffd085945d57c2d9a5da745cfb5228c02bc90f2c74bbac746243/pyperclip-1.7.0.tar.gz
Installing collected packages: Pillow, pyscreeze, pyrect, pygetwindow, pyperclip, mouseinfo, PyAutoGUI
  Running setup.py install for Pillow: started
    Running setup.py install for Pillow: finished with status 'error'
    Complete output from command "c:\users\redacted\venv\Scripts\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\xxx\\AppData\\Local\\Temp\\pycharm-packaging\\Pillow\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\xxx\AppData\Local\Temp\pip-record-mbf90130\install-record.txt --single-version-externally-managed --compile --install-headers "c:\users\redacted\venv\include\site\python3.8\Pillow":

    ...

    The headers or library files could not be found for zlib,
    a required dependency when compiling Pillow from source.

    Please see the install instructions at:
       https://pillow.readthedocs.io/en/latest/installation.html



    ----------------------------------------

...Pillow"" failed with error code 1 in C:\Users\xxx\AppData\Local\Temp\pycharm-packaging\Pillow\

Кажется, что это связано с подушкой, но я не могу понять это. Есть идеи?

...