最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

`subprocess.run` invokes an executable (not script) using the python interpreter when it's not necessary - Stack Overflo

programmeradmin3浏览0评论

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?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论