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:
[email protected]:~ $ nano pyautogui.py
[email protected]:~ $ python pyautogui.py
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'pyautogui']
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'pyautogui']
[email protected]:~ $
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


Forum Jump:

User Panel Messages

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