parham
parham

Reputation: 61

python: How do I import PyAutoGUI

import pyautogui

I am getting an import error:

Traceback (most recent call last):
  File "<stdin>", line 1, in
  File "/usr/local/lib/python3.7/site-packages/pyautogui/__init__.py", line 150, in <module>
    from pymsgbox import alert, confirm, prompt, password File "/usr/local/lib64/python3.7/site-packages/pymsgbox/__init__.py", line 56, in <module>
    if tk.TkVersion < 8.0: AttributeError: module 'tkinter' has no attribute 'TkVersion'

Upvotes: 2

Views: 506

Answers (3)

spacycookie
spacycookie

Reputation: 138

I switched to version PyAutoGUI==0.9.0, and it worked (python 3.11, Ubuntu 24.04.1 LTS)

Upvotes: 0

Kobe Van Den Broeck
Kobe Van Den Broeck

Reputation: 1

Maybe it's because you didn't install pyautogui or don't you have the latest version (this can also be done by reinstalling it). This video explains how to install pyautogui: https://youtu.be/-jxt7pVNAAk

The error looks unfamiliar to me, so I don't know if that's the issue. It also discribes more than 1 line.

Upvotes: 0

EasyWay Coder
EasyWay Coder

Reputation: 341

The error is clearly showing AttributeError: module 'tkinter' has no attribute 'TkVersion' so either your Tkinter module isn't updated, or your Tkinter module has some errors

Upvotes: 0

Related Questions