[Python] `subprocess.run` invokes an executable (not script) using the python interpreter when...

Discussão em 'Python' iniciado por Stack, Fevereiro 11, 2025.

  1. Stack

    Stack Membro Participativo

    Related: After pakage a python to a exe with pyinstaller, why it can not run on a new computer?

    I'm packaging a command line application with a thin GUI wrapper written in Python using pyinstaller. I received feedback from user that it's not running. Specifically, the error message says (partially redacted):

    Fatal error in launcher: Unable to create process using '"C:\Users\DannyNiu\source\repos\AutoSub\whisper-root\Scripts\python.exe" "C:\Users\DannyNiu\source\repos\AutoSub-Done\dist\main-batch\_internal\whisper-root\Scripts\whisper.exe" ...


    I've got a venv in "whisper-root", and the error message seem to suggest that the executable file ("whisper.exe") is being run by the Python interpreter. The venv was in the folder "AutoSub", which I renamed to "AutoSub-Done" to induce the error.

    Here's how I've been invoking the executable:

    ...
    base = os.path.dirname(__file__)
    ...
    whisper = base+"/whisper-root/Scripts/whisper.exe"
    ...
    subprocess.run([whisper, ...arguments...], executable = whisper)
    ...


    What am I supposed to do?

    Continue reading...

Compartilhe esta Página