python 3 pyinstaller一直给出“创建进程失败”

时间:2016-09-16 06:20:35

标签: python-3.x pyinstaller

我的基本c:\文件夹中的pyinstaller,我的c:Pyinstaller文件夹中的myfile.py以及pyinstaller myfile,py和pyinstaller pyinstaller \ myfile.py都给出了“创建进程失败”我做错了什么?

4 个答案:

答案 0 :(得分:0)

你似乎在做C: - 这是任何最新版windows的受保护区域。

我建议将其移动到更易于访问的位置,例如文档文件夹甚至桌面。它可能只是一个权限问题。

或者,您可以尝试以管理员身份运行pyinstaller。通常可以通过右键单击可执行文件并选择Run as administrator来完成此操作。

答案 1 :(得分:0)

我遇到了同样的问题,所以我检查了文件

C:\Python27\Scripts\pyinstaller-script.py

还有一个旧的python路径,当我安装python安装程序时

C:\Python27\python.exe

但是后来我重命名了python.exe-> python2.exe,所以我只更改了路径

C:\Python27\python.exe --> C:\Python27\python2.exe

在文件中

C:\Python27\Scripts\pyinstaller-script.py

效果很好。

答案 2 :(得分:0)

如果以上方法均无效,请尝试直接调用python exe文件和pyinstaller-script文件。

<absolute path to python exe> <absolute path to pyinstaller script> <yourfile>.py

例如,

"C:\Users\Dilan Sachintha\AppData\Local\Programs\Python\Python37\python.exe" "C:\Users\Dilan Sachintha\AppData\Local\Programs\Python\Python37\Scripts\pyinstaller-script.py" --onefile temp.py

答案 3 :(得分:-1)

您可能遇到PyInstaller(#1832)的错误,当.py文件的路径中有空格时,会导致PyInstaller因“创建进程失败”错误而崩溃。

尝试将文件移动到其中没有空格的文件夹中,然后重试。

另外,请看这里:

Installing pyinstaller via pip leads to "failed to create process"

pip/easy_install failure: failed to create process