Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is this normal?
#1
Hi everyone
I am a newbie so bear with me, I watched a youtube video on how to install PYAutoGUI, I believe its installed it correctly but now I want to upload the library I get the error message

>>>import pyautogui
Traceback (most recent call ):
File "<stdin> line 1 in <module>
ModuleNotFound: No module name 'pyautogui'

is this normal?

Thank you for your help.
Reply
#2
Check the version of python you installed it for. The error is saying it's not installed.
Best practice is to create a virtual environment activate it and install there.

I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
Download my project scripts


Reply
#3
It is normal if you have not installed pyautogui. pyautogui is not part of the standard python distribution and must be installed separately.

This is what happens when I type your command on my computer:
Output:
PS C:\Users\djhys\Documents\python\musings> python Python 3.11.1 (tags/v3.11.1:a7a450f, Dec 6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import pyautogui Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'pyautogui' >>>
Now I install pyautogui. pyauto gui is a pretty big install, so I'm leaving out much of the output.
Output:
PS C:\Users\djhys\Documents\python\musings> pip install pyautogui Collecting pyautogui Downloading PyAutoGUI-0.9.54.tar.gz (61 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.2/61.2 kB 1.6 MB/s eta 0:00:00 Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting pymsgbox (from pyautogui) Downloading PyMsgBox-1.0.9.tar.gz (18 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting pytweening>=1.0.4 (from pyautogui) Downloading pytweening-1.2.0.tar.gz (171 kB) . . . much left out here ' ' ' Successfully built pyautogui pygetwindow pyscreeze pytweening mouseinfo pymsgbox pyrect Installing collected packages: pytweening, pyrect, pymsgbox, pyscreeze, pygetwindow, mouseinfo, pyautogui Successfully installed mouseinfo-0.1.3 pyautogui-0.9.54 pygetwindow-0.0.9 pymsgbox-1.0.9 pyrect-0.2.0 pyscreeze-1.0.1 pytweening-1.2.0 PS C:\Users\djhys\Documents\python\musings>
And now I try to import the module again.
Output:
PS C:\Users\djhys\Documents\python\musings> python Python 3.11.1 (tags/v3.11.1:a7a450f, Dec 6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import pyautogui >>>
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  tkinter button acts normal ONLY after clicking off the window justin_m 8 7,844 Apr-24-2018, 06:14 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020