2
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'

4
  • Did you name your script tkinter.py? Commented Sep 11, 2020 at 9:48
  • How is this error related to PyAutoGui? Commented Sep 11, 2020 at 16:41
  • acw1668 no i didnt Commented Sep 16, 2020 at 11:26
  • The Laggy Tablet - i dont know, i think in some cases like opening window or something else PyAutoGui has some conflicts with tkinter :| now however im using pyscreenshot library instead and its works Commented Sep 16, 2020 at 12:08

3 Answers 3

0

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

Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

0

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.