Форум сайта python.su
Доброе утро. Попытался установить AHK и запустить скрипт для проверки
from ahk import AHK ahk = AHK() ahk.run_script('Run Notepad') notepad_window = ahk.find_window_by_title(b'Untitled - Notepad') notepad_window.send('Hello World')
C:\Users\Андрей\PycharmProjects\LA2_test\venv\Scripts\python.exe C:\Users\Андрей\PycharmProjects\LA2_test\la2.py Traceback (most recent call last): File "C:\Users\Андрей\PycharmProjects\LA2_test\la2.py", line 2, in <module> ahk = AHK() File "C:\Users\Андрей\PycharmProjects\LA2_test\venv\lib\site-packages\ahk\window.py", line 630, in __init__ super().__init__(*args, **kwargs) File "C:\Users\Андрей\PycharmProjects\LA2_test\venv\lib\site-packages\ahk\mouse.py", line 61, in __init__ super().__init__(**kwargs) File "C:\Users\Андрей\PycharmProjects\LA2_test\venv\lib\site-packages\ahk\gui.py", line 12, in __init__ super().__init__(*args, **kwargs) File "C:\Users\Андрей\PycharmProjects\LA2_test\venv\lib\site-packages\ahk\script.py", line 89, in __init__ self.executable_path = _resolve_executable_path(executable_path) File "C:\Users\Андрей\PycharmProjects\LA2_test\venv\lib\site-packages\ahk\script.py", line 49, in _resolve_executable_path raise ExecutableNotFoundError( ahk.script.ExecutableNotFoundError: Could not find AutoHotkey.exe on PATH. Provide the absolute path with the `executable_path` keyword argument or in the AHK_PATH environment variable. You may be able to resolve this error by installing the binary extra: pip install "ahk[binary]" Process finished with exit code 1.
Офлайн
Странно как то, после установки AutoHotkey, не могу найти AutoHotkey.exe. Хотя программа установилась в C:\Program Files\AutoHotkey.
C:\Users\Андрей\PycharmProjects\pythonProject\venv\Scripts\python.exe C:\Users\Андрей\PycharmProjects\pythonProject\main.py Traceback (most recent call last): File "C:\Users\Андрей\PycharmProjects\pythonProject\main.py", line 3, in <module> ahk = AHK() File "C:\Users\Андрей\PycharmProjects\pythonProject\venv\lib\site-packages\ahk\window.py", line 630, in __init__ super().__init__(*args, **kwargs) File "C:\Users\Андрей\PycharmProjects\pythonProject\venv\lib\site-packages\ahk\mouse.py", line 61, in __init__ super().__init__(**kwargs) File "C:\Users\Андрей\PycharmProjects\pythonProject\venv\lib\site-packages\ahk\gui.py", line 12, in __init__ super().__init__(*args, **kwargs) File "C:\Users\Андрей\PycharmProjects\pythonProject\venv\lib\site-packages\ahk\script.py", line 89, in __init__ self.executable_path = _resolve_executable_path(executable_path) File "C:\Users\Андрей\PycharmProjects\pythonProject\venv\lib\site-packages\ahk\script.py", line 49, in _resolve_executable_path raise ExecutableNotFoundError( ahk.script.ExecutableNotFoundError: Could not find AutoHotkey.exe on PATH. Provide the absolute path with the `executable_path` keyword argument or in the AHK_PATH environment variable. You may be able to resolve this error by installing the binary extra: pip install "ahk[binary]" Process finished with exit code 1
Офлайн