Проблема с кодом на python и библиотеками Pyatogui и Tkinter
Егор Володичев
Знаток
(386),
на голосовании
7 месяцев назад
вообщем суть кода в том чтобы при нажатии кнопки, по полученным из введёных строк числам мышка передвигалась по нужным координатам но почему то вылазит ошибка:
Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\Пользователь\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyautogui\__init__.py", line 663, in _normalizeXYArgs location = locateOnScreen(firstArg) ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Пользователь\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyautogui\__init__.py", line 228, in _couldNotImportPyScreeze raise PyAutoGUIException( pyautogui.PyAutoGUIException: PyAutoGUI was unable to import pyscreeze. (This is likely because you're running a version of Python that Pillow (which pyscreeze depends on) doesn't support currently.) Please install this module to enable the function you tried to call.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\Пользователь\AppData\Local\Programs\Python\Python312\Lib\tkinter\__init__.py", line 1967, in __call__ return self.func(*args) ^^^^^^^^^^^^^^^^ File "c:\Users\Пользователь\Untitled-1.py", line 12, in move_mouseTo pyautogui.moveTo(x,y) File "C:\Users\Пользователь\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyautogui\__init__.py", line 594, in wrapper returnVal = wrappedFunction(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Пользователь\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyautogui\__init__.py", line 1285, in moveTo x, y = _normalizeXYArgs(x, y) ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Пользователь\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyautogui\__init__.py", line 670, in _normalizeXYArgs except pyscreeze.ImageNotFoundException: ^^^^^^^^^ NameError: name 'pyscreeze' is not defined
вот сам код
from tkinter import * from tkinter import ttk import pyautogui
но почему то вылазит ошибка:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\Пользователь\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyautogui\__init__.py", line 663, in _normalizeXYArgs
location = locateOnScreen(firstArg)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Пользователь\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyautogui\__init__.py", line 228, in _couldNotImportPyScreeze
raise PyAutoGUIException(
pyautogui.PyAutoGUIException: PyAutoGUI was unable to import pyscreeze. (This is likely because you're running a version of Python that Pillow (which pyscreeze depends on) doesn't support currently.) Please install this module to enable the function you tried to call.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Пользователь\AppData\Local\Programs\Python\Python312\Lib\tkinter\__init__.py", line 1967, in __call__
return self.func(*args)
^^^^^^^^^^^^^^^^
File "c:\Users\Пользователь\Untitled-1.py", line 12, in move_mouseTo
pyautogui.moveTo(x,y)
File "C:\Users\Пользователь\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyautogui\__init__.py", line 594, in wrapper
returnVal = wrappedFunction(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Пользователь\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyautogui\__init__.py", line 1285, in moveTo
x, y = _normalizeXYArgs(x, y)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Пользователь\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyautogui\__init__.py", line 670, in _normalizeXYArgs
except pyscreeze.ImageNotFoundException:
^^^^^^^^^
NameError: name 'pyscreeze' is not defined
вот сам код