ValueError: The 'ahk' package was not installed in a way that PackageLoader understands

888 views Asked by At

First and Foremost thank you to whomever can help me. I love Stackoverflow and couldn't imagine living without it as a Developer.

My problem: I built an AutoHotKey Script inside Python, so I can get a GUI in front of it. The script works awesome. The issue is, when I compile it to an .exe through python. I receive the message below:

enter image description here

Text of issue:

Traceback (most recent call last): File "test.pyw", line 14, in ahk = AHK() ^^^^^ File "ahk_sync\engine.py", line 130, in init File "ahk_sync\transport.py", line 610, in init File "jinja2\loaders.py", line 323, in init ValueError: The 'ahk' package was not installed in a way that PackageLoader understands.


Troubleshooting I've done: -Uninstalled & reinstall: VSCODE, PYTHON, and AutoHotKey multple times. -Doublechecked that I had the latest versions of all 3 -Tried different Autohotkey modules -Added all folder paths to the System Environment on my PC -Employed ChatGPT to help -Employeed Youtube -checked site-packages

All the above have not granted me a solution. What I am expecting is to run the .exe with no issues. I don't want to have to open VSCODE everytime I want to run my script.

Please help! Thank you :)

1

There are 1 answers

0
sytech On

ahk author here. This issue should now be resolved in v1.1.3.

Basically, if you package ahk as a dependency into a frozen/compiled app, many tools used for freezing Python apps don't automatically include package data needed for normal functionality. This can usually be resolved through a proper configuration in building/freezing your app, but to make this easier for users, in v1.0.0, we introduced a fallback mechanism for these cases, but until 1.1.3, this mechanism was not working correctly.