Skip to content

AHKPY immediately terminates without error #8

Open
@t89

Description

@t89

I use this module on three Windows machines and it worked flawlessly. It's an awesome tool, thank you for developing it.

A couple of days ago I decided to migrate one of the machines to a proper python environment. I'm usually not working on the machine and didn't spend the time to setup python properly, initially.

I uninstalled the system python, and installed python 3.10.2 using pyenv. The other machines are running the same python version and are running fine. I then installed other modules and did not experience any kind of trouble until I attempted to run 2 of my scripts via python -m ahkpy script.py:

This command returns an empty line and terminates immediately. No error, no logs. Same effect when I call python -m ahkpy -h. Any idea how I could debug the problem without cloning this repo and doing the pip install -e . shenanigans?

I did:

  • run from both elevated and non-elevated terminals
  • uninstall and check if the import is still working; it is not
  • reinstall autohotkey.py
  • make sure it was installed for the correct python version I even installed it using python -m pip install autohotkey.py
  • triple check it's running on the correct pyenv python executable
  • successfully import ahkpy from within the interpreter; no import errors
  • run two scripts that work on other machines and are located in different directories; no namespace conflicts
  • check if AutoHotkey.exe is working properly; also checked if there were python / ahk processes running in the background and terminated them all
  • reboot / restart terminal sessions
  • check system path and removed the old system python paths (even renamed them to make sure it's not importing from the old folder)
  • run a script directly using python script.py and I correctly receive the RuntimeError: AHK interop is not available. Please start your code as 'py -m ahkpy main.py'.

I am not using virtualenv.

Locations:

    c:\users\tommi\.pyenv\pyenv-win\versions\3.10.2\lib\site-packages\ahkpy\*
    c:\users\tommi\.pyenv\pyenv-win\versions\3.10.2\lib\site-packages\autohotkey.py-0.1.2.dist-info\*
    c:\users\tommi\.pyenv\pyenv-win\versions\3.10.2\scripts\ahkpy.exe

    $ pyenv which python
    C:\Users\Tommi\.pyenv\pyenv-win\versions\3.10.2\python.exe
    
    $ pyenv which pip
    C:\Users\Tommi\.pyenv\pyenv-win\versions\3.10.2\Scripts\pip.exe

Any idea what I am missing and how to debug the situation? Thank you for your time!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions