你能改变pyinstaller认为python.exe所在的路径吗?



我想使用pyinstaller来制作独立的exe文件。我使用了

pip install pyinstaller

首先是,然后我得到了一个错误消息,我马上会给你看,所以我使用了

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip

因为我是在pyinstaller网站上找到的。因此,我将cd放入我的脚本所在的文件夹中,我认为您不需要setup.py文件或pyinstaller的任何东西,就像您需要使用py2exe一样,然后我使用命令

pyinstaller file.py --onefile

,我得到错误消息(我翻译最后一部分,所以它不是100%准确)

启动器致命错误:无法使用'"c:pythonpython.exe"C: Python脚本 pyinstaller.exe"gtaReminder.py——onefile':系统无法找到指定的文件。

我认为pyinstaller认为python.exe位于c:pythonpython.exe,因为它在错误信息中说。我只是打开了一条路,但它不是。我可以改变这个路径pyinstaller认为它可以找到python.exe吗?我在windows 10上使用python 3.6.2,pip 20.3.3

首先,你的命令行语法是错误的,它总是应该是可选参数后面跟着强制参数,下面是通用语法

pyinstaller [options] script [script…]| specfile

阅读这里的文档

正确的命令应为

pyinstaller --onefile file.py

这个错误并不表明pyinstaller得到了错误的python文件,事实上它可以告诉

无法使用'"c:pythonpython.exe"C: Python脚本 pyinstaller.exe"

表示它能够找到python文件并尝试启动进程,但未能完全执行任务。

最新更新