Python Forum
pyautogui attribuyes not found
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pyautogui attribuyes not found
#1
I'm fairly new to python programming. I installed pyautogui.

I was just starting a basic tutorial on using it with these two lines:

import pyautogui
print(pyautogui.size())
and I get an error saying size is not an attribute.

How can I tell if my installation was successful?

Thank you...
Reply
#2
The import not raising an exception is a good sign. What do rou see if you type
Output:
>>>import pyautogui dir(pyautogui)
Reply
#3
>>>import pyautogui
bash: import: command not found

I put

import pyautogui
print(dir(pyautogui))

into a script and ran it:
pi@raspberrypi:~ $ nano pyautogui.py
pi@raspberrypi:~ $ python pyautogui.py
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'pyautogui']
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'pyautogui']
pi@raspberrypi:~ $
Reply
#4
That does not look right. I would expect to see a bunch of function names. You can also try
Output:
>>>import pyautogui >>>help(pyaugogui)
I don't think you have the package installed correctly. Did you use pip? What platform are you using? What version of Python?
Reply
#5
I'm using Python 3.7
Raspberry Pi 4
I used pip3 to install it.

When I run help(pyautogui) in my nano script:

Help on Module pyautogui:
NAME
pyautogui

FILE
/home/pi/pyautogui.py
NONE

The above displays twice for each script run.

How do I remove what I have and I'll try to reinstall it again.
Reply
#6
My re-install was successful...yahoo!!!
Reply
#7
Did you identify why the old install failed?
Reply
#8
(Feb-24-2021, 12:01 AM)deanhystad Wrote: Did you identify why the old install failed?

Sorry, no I did not.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Please help me in regards to pyAutoGUI andrewtuk 2 1,424 Jan-01-2023, 05:22 PM
Last Post: gradlon93
  How can I loop PyAutoGUI's locateCenterOnScreen until the image is found? Tiel 2 7,553 Sep-26-2021, 09:39 AM
Last Post: Tiel
  PyAutoGUI issues with detection Bizzy_ 0 4,884 May-03-2021, 01:36 AM
Last Post: Bizzy_

Forum Jump:

User Panel Messages

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