Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AHK throws a ExecutableNotFoundError even with ahk-binary installed #171

Closed
Saad-Mufti opened this issue Jul 29, 2022 · 2 comments
Closed

Comments

@Saad-Mufti
Copy link

I'm trying to get ahk to work with the ahk-binary package, and testing whether it works with this simple snippet:

from ahk import AHK
ahk = AHK()

But I still get a ExecutableNotFoundError. Am I doing something wrong? I'm on Windows 11 and do have pip on my path.

@spyoungtech
Copy link
Owner

Hmm. Could you tell me what version of Python you are using?

A few things might be going on here... the most common issue would be that the Scripts directory is not on PATH or you have multiple versions of Python and have installed the package to a different interpreter.

Using a virtualenv is the most reliable way to test this.
Type these commands into the command prompt to create a virtualenv and see if you get the same error:

py -m venv venv
venv\Scripts\activate
pip install ahk "ahk[binary]"
python -c "from ahk import AHK; ahk = AHK()"

If it still shows an error, check the contents of venv\Scripts -- AutoHotkey.exe should appear there after installing ahk-binary. If not, then something might be wrong on my end.

@Saad-Mufti
Copy link
Author

So, using a venv did end up working, so it seems it's a problem in my environment. I thought it wasn't because I was able to import ahk-binary too so I figured if it could see ahk-binary, then it should be all set. If I had to guess, it might be something related to having both Python 3.9 and 3.8 on my PATH (my test was done in 3.9 though).

Anyway, thanks for your help, and sorry for the bother!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants