Уведомления

Группа в Telegram: @pythonsu

#1 Март 15, 2023 10:07:10

sonso
Зарегистрирован: 2023-03-15
Сообщения: 2
Репутация: +  0  -
Профиль   Отправить e-mail  

AHK ошибка

Доброе утро. Попытался установить 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_2.0.2.zip

Офлайн

#2 Март 16, 2023 13:15:58

sonso
Зарегистрирован: 2023-03-15
Сообщения: 2
Репутация: +  0  -
Профиль   Отправить e-mail  

AHK ошибка

Странно как то, после установки 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

Офлайн

Board footer

Модераторировать

Powered by DjangoBB

Lo-Fi Version