import error for pyautogui
Asked Answered
C

6

20

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 getting an import error:

ImportError: No module named pyautogui

What am I doing wrong? Did the command change? Sorry I am a total python Noob, any help is greatly appreciated :D

Coterie answered 26/7, 2015 at 8:40 Comment(0)
M
19

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.

Monitor answered 26/7, 2015 at 8:57 Comment(0)
E
20

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.

Effeminize answered 8/8, 2015 at 16:31 Comment(1)
worked also for me using windowsDelve
M
19

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.

Monitor answered 26/7, 2015 at 8:57 Comment(0)
W
11

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
Weitman answered 23/6, 2020 at 10:22 Comment(1)
It did not install correctly using pip install pyautogui but did install correctly using python -m pip install (not python3)Brisling
M
5

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! :)

Mover answered 12/10, 2018 at 8:1 Comment(1)
pip install pillow was the last thing I needed to make it work. Thanks!Bookplate
D
0
# using py alias (Windows)
py -m pip install pyautogui

Source: https://bobbyhadz.com/blog/python-no-module-named-pyautogui

Duffer answered 12/2 at 19:36 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Rugged
F
-3

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

Forepart answered 22/8, 2020 at 14:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.