Python Forum

Full Version: pyautogui attribuyes not found
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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...
The import not raising an exception is a good sign. What do rou see if you type
Output:
>>>import pyautogui dir(pyautogui)
>>>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:~ $
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?
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.
My re-install was successful...yahoo!!!
Did you identify why the old install failed?
(Feb-24-2021, 12:01 AM)deanhystad Wrote: [ -> ]Did you identify why the old install failed?

Sorry, no I did not.