通过 pip 安装 pyinstaller 导致 "failed to create process"
Installing pyinstaller via pip leads to "failed to create process"
有谁知道为什么 pyinstaller
在通过 pip
通过 anaconda 32bit
安装后立即失败?
我使用 32 位 anaconda 在 Windows 64 位上通过 anaconda 命令提示符通过 pip install pyinstaller
安装了 pyinstaller(因为我想创建 32 位可执行文件)
是的我读了pyinstaller --version failed to create a process and pip/easy_install failure: failed to create process and How to install pyinstaller using pip
我没有重命名我在 15 分钟前、pycharm 10 分钟前和 pyinstaller 5 分钟前安装的任何文件。我通过 pup uninstall 卸载了 pyinstaller 并在 anaconda 脚本文件夹中重新安装,这没有任何作用。
有什么见解吗? #windowsfrustrations
小路
C:\Users\me\Anaconda\Lib\site-packages>PyInstaller
就我而言,我卸载并安装了 pyinstaller,然后一切正常。
可能与安装后python内的任何变化有关,所以重新安装是一个不错的选择。
卸载:
pip uninstall pyinstaller
安装:
pip install pyinstaller
当 Python 的(或 PyInstaller 的)路径包含 space 时(例如,将 Python 安装到 Program Files (x86)
目录时,似乎会出现此错误.)
我怀疑 PyInstaller 的源代码中某处缺少引号。
尝试在没有 space 的路径中安装 Python,然后将 PyInstaller(通过 pip)安装到该路径。
我通过这样做修复了它 [Anaconda 3.4]:
- 输入 Anaconda 命令提示符
- 通过以下方式进入 anaconda 脚本文件夹:cd /path/to/anaconda/Scripts
- 写入:python pyinstaller-script.py path/YourScript.py
工作得很好。
[更新:很明显,根修复是在 setuptools 中。该修复进入了 2016 年 7 月 23 日发布的 setuptools 版本 24.3.1。升级到比该版本更新的版本应该可以解决这个问题。]
原来这是一个bug in pip。正如另一个答案中提到的,python 安装路径中的空格有问题。
具体来说,它在生成的启动器脚本中省略了引号。这些脚本可以在 \Scripts\ 中找到(例如 C:\Program Files\Python 3.5\Scripts)。对于 pyinstaller,有 4 个 pyi-* 和一个 pyinstaller-script.py 脚本。
您可以通过编辑每个脚本的第一行相对轻松地解决此问题。生成的第一行看起来像:
#!c:\program files\python 3.5\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'PyInstaller==3.1.1','console_scripts','pyinstaller'
只需在 shebang 命令周围添加引号,如下所示:
#!"c:\program files\python 3.5\python.exe"
如 StationaryTraveller 所述,您可以通过调用脚本 pyinstaller-script.py
来解决此错误
下面是一个例子
C:>"C:\Program Files (x86)\Python35-32\python.exe" "C:\Program Files (x86)\Python35-32\Scripts\pyinstaller-script.py" script_to_compile.py
"C:\Program Files\Python35-32\python.exe" "C:\Program Files\Python35-32\Scripts\pyinstaller-script.py" --onefile --windowed ex_btn.py
--onefile : 只创建 exe,
--windowed : 排除提示的 CMD,
ex_btn.py : python 脚本文件。
这很有魅力。
截至 2016 年 7 月,该问题已被报告为已修复,升级 pip、setuptools,然后卸载并安装 pyinstaller 应该可以解决问题
python -m pip install pip
对我有用。
使用 Python 3.5.2 和 3.6.0 的 Anaconda 版本(针对此错误进行了升级,但两个版本的错误似乎相同),我遇到了与命令相同的错误消息 pip install pip
,或pip install whatever
/conda install whatever
。
我同时拥有 Python 2.7 和 3.5,但是 pip install --upgrade pip
每天都在工作,直到几天前。
即使更新了 pip 和 setuptools,我也有同样的问题,问题是在 C:\Python35\Scripts\ 目录中找到的 pyinstaller-script.py 的 [= 路径错误22=].
我系统上的 Python 以某种方式安装在 AppData 中,但它的脚本和模块安装在 C:\Python35\ 文件夹中。
将 pyinstaller-script.py 的第一行更改为 python.exe 的正确路径(AppData 中的 Programs 目录),如果文件夹名称中有任何 space,则用引号引起来,它应该可以工作并且不再显示 "Failed to create process"。
示例:
#!C:\Program" "Files" "(x86)\Python\python.exe
使用 Windows10 和 Python35 官方安装程序以某种方式安装了 Python。
有谁知道为什么 pyinstaller
在通过 pip
通过 anaconda 32bit
安装后立即失败?
我使用 32 位 anaconda 在 Windows 64 位上通过 anaconda 命令提示符通过 pip install pyinstaller
安装了 pyinstaller(因为我想创建 32 位可执行文件)
是的我读了pyinstaller --version failed to create a process and pip/easy_install failure: failed to create process and How to install pyinstaller using pip
我没有重命名我在 15 分钟前、pycharm 10 分钟前和 pyinstaller 5 分钟前安装的任何文件。我通过 pup uninstall 卸载了 pyinstaller 并在 anaconda 脚本文件夹中重新安装,这没有任何作用。
有什么见解吗? #windowsfrustrations
小路
C:\Users\me\Anaconda\Lib\site-packages>PyInstaller
就我而言,我卸载并安装了 pyinstaller,然后一切正常。
可能与安装后python内的任何变化有关,所以重新安装是一个不错的选择。
卸载:
pip uninstall pyinstaller
安装:
pip install pyinstaller
当 Python 的(或 PyInstaller 的)路径包含 space 时(例如,将 Python 安装到 Program Files (x86)
目录时,似乎会出现此错误.)
我怀疑 PyInstaller 的源代码中某处缺少引号。
尝试在没有 space 的路径中安装 Python,然后将 PyInstaller(通过 pip)安装到该路径。
我通过这样做修复了它 [Anaconda 3.4]:
- 输入 Anaconda 命令提示符
- 通过以下方式进入 anaconda 脚本文件夹:cd /path/to/anaconda/Scripts
- 写入:python pyinstaller-script.py path/YourScript.py
工作得很好。
[更新:很明显,根修复是在 setuptools 中。该修复进入了 2016 年 7 月 23 日发布的 setuptools 版本 24.3.1。升级到比该版本更新的版本应该可以解决这个问题。]
原来这是一个bug in pip。正如另一个答案中提到的,python 安装路径中的空格有问题。
具体来说,它在生成的启动器脚本中省略了引号。这些脚本可以在 \Scripts\ 中找到(例如 C:\Program Files\Python 3.5\Scripts)。对于 pyinstaller,有 4 个 pyi-* 和一个 pyinstaller-script.py 脚本。
您可以通过编辑每个脚本的第一行相对轻松地解决此问题。生成的第一行看起来像:
#!c:\program files\python 3.5\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'PyInstaller==3.1.1','console_scripts','pyinstaller'
只需在 shebang 命令周围添加引号,如下所示:
#!"c:\program files\python 3.5\python.exe"
如 StationaryTraveller 所述,您可以通过调用脚本 pyinstaller-script.py
下面是一个例子
C:>"C:\Program Files (x86)\Python35-32\python.exe" "C:\Program Files (x86)\Python35-32\Scripts\pyinstaller-script.py" script_to_compile.py
"C:\Program Files\Python35-32\python.exe" "C:\Program Files\Python35-32\Scripts\pyinstaller-script.py" --onefile --windowed ex_btn.py
--onefile : 只创建 exe, --windowed : 排除提示的 CMD, ex_btn.py : python 脚本文件。
这很有魅力。
截至 2016 年 7 月,该问题已被报告为已修复,升级 pip、setuptools,然后卸载并安装 pyinstaller 应该可以解决问题
python -m pip install pip
对我有用。
使用 Python 3.5.2 和 3.6.0 的 Anaconda 版本(针对此错误进行了升级,但两个版本的错误似乎相同),我遇到了与命令相同的错误消息 pip install pip
,或pip install whatever
/conda install whatever
。
我同时拥有 Python 2.7 和 3.5,但是 pip install --upgrade pip
每天都在工作,直到几天前。
即使更新了 pip 和 setuptools,我也有同样的问题,问题是在 C:\Python35\Scripts\ 目录中找到的 pyinstaller-script.py 的 [= 路径错误22=].
我系统上的Python 以某种方式安装在 AppData 中,但它的脚本和模块安装在 C:\Python35\ 文件夹中。
将 pyinstaller-script.py 的第一行更改为 python.exe 的正确路径(AppData 中的 Programs 目录),如果文件夹名称中有任何 space,则用引号引起来,它应该可以工作并且不再显示 "Failed to create process"。 示例:
#!C:\Program" "Files" "(x86)\Python\python.exe
使用 Windows10 和 Python35 官方安装程序以某种方式安装了 Python。