import error for pyautogui

前端 未结 5 1928
囚心锁ツ
囚心锁ツ 2021-01-04 08:48

I installed the pyautogui module and dependencies via pip-3.2 on my raspi correctly, However when I am trying to do

import pyautogui

I am g

相关标签:
5条回答
  • 2021-01-04 09:06

    If you run your script with sudo, you should install the module also under sudo...

    0 讨论(0)
  • 2021-01-04 09:10

    Search in C:\Python37-32\Lib\site-packages (Where-ever you have installed it). Check if you have pyautogui directory.

    If YES then there exists a configuration issue with pycharm or IDLE.

    If NO then

    • Open Command Prompt
    • cd C:\Python37-32\Scripts
    • pip install pillow
    • pip install pyautogui

    Check for Successfully installed response.

    HAPPY CODING! :)

    0 讨论(0)
  • 2021-01-04 09:13

    True you would have to use python 3. First you have to make sure you checked the change system path variable while installing python 3. then open the command prompt on windows and type

    pip install pyautogui 
    

    or

    pip3 install pyautogui
    

    in osx and linux.

    0 讨论(0)
  • 2021-01-04 09:18

    It might be because you're trying it from a python 2.x shell. Instead try this command on a python3 shell and try importing the same.

    0 讨论(0)
  • 2021-01-04 09:26

    I also had a hard time getting pyautogui to work via Terminal on my macOS Catalina. I installed it using pip3 install pyautogui. It supposedly installed but still gave error: No module named 'pyautogui', when I tried to import it (after running python3). What finally worked was this command I found on the pyautogui documentation page (https://pyautogui.readthedocs.io/en/latest/install.html):

    python3 -m pip install pyautogui
    

    If it says permission denied, try:

    python3 -m pip install --user pyautogui
    
    0 讨论(0)
提交回复
热议问题