通过 pip 安装 pyinstaller 导致“无法创建进程" [英] Installing pyinstaller via pip leads to "failed to create process"

查看:54
本文介绍了通过 pip 安装 pyinstaller 导致“无法创建进程"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道为什么 pyinstaller 在通过 anaconda 32bit 通过 pip 安装后立即失败?

Does anyone know why pyinstaller immediately fails after installed via pip via anaconda 32bit?

我通过 pip install pyinstaller 在 Windows 64 位上使用 32 位 anaconda 通过 anaconda 命令提示符安装了 pyinstaller(因为我想创建 32 位可执行文件)

I installed pyinstaller via pip install pyinstaller through the anaconda command prompt on Windows 64 bit using 32 bit anaconda (because I want to create 32 bit executables)

是的,我读了 pyinstaller --version 未能创建进程pip/easy_install failure: failed to create process如何使用pip安装pyinstaller

Yes I read pyinstaller --version failed to create a process and pip/easy_install failure: failed to create process and How to install pyinstaller using pip

我没有重命名我 15 分钟前安装的 anaconda、10 分钟前安装的 pycharm 和 5 分钟前安装的 pyinstaller 的任何文件.我通过 pup uninstall 卸载了 pyinstaller 并在 anaconda 脚本文件夹中重新安装,这没有任何作用.

I did not rename any files I installed anaconda 15 mins ago, pycharm 10 mins ago, and pyinstaller 5 mins ago. I uninstalled pyinstaller via pup uninstall and reinstalled in the anaconda scripts folder, this did nothing.

有人有任何见解吗?#windowsfrustrations小路C:UsersmeAnacondaLibsite-packages>PyInstaller

Any insight anyone? #windowsfrustrations Path C:UsersmeAnacondaLibsite-packages>PyInstaller

推荐答案

[更新:显然,此问题的根本修复在 setuptools 中.2016 年 7 月 23 日发布的 setuptools 版本 24.3.1 中已修复.升级到任何更新的版本都应该解决这个问题.]

[Update: So apparently the root fix for this is in setuptools. The fix went into setuptools version 24.3.1 released July 23, 2016. Upgrading to anything newer than that should take care of this.]

事实证明这是一个 pip 中的错误.如另一个答案中所述,python 安装路径中存在空格问题.

It turns out this is a bug in pip. As mentioned in the other answer it has a problem with spaces in the path to the python install.

特别是它在生成的启动器脚本中省略了引号.脚本可以在 Scripts(例如 C:Program FilesPython 3.5Scripts)中找到.对于 pyinstaller,有 4 个 pyi-* 和一个 pyinstaller-script.py 脚本.

Specifically it leaves out quote marks in the generated launcher scripts. The scripts can be found in Scripts (e.g. C:Program FilesPython 3.5Scripts). For pyinstaller there 4 pyi-* and a pyinstaller-script.py scripts.

您可以通过编辑每个脚本的第一行来相对轻松地解决此问题.生成的第一行看起来像:

You can work around this relatively easily by editing the first line of each script. The generated first lines will look something like:

#!c:program filespython 3.5python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'PyInstaller==3.1.1','console_scripts','pyinstaller'

只需在shebang命令周围添加引号,如下所示:

Just add quotes around the shebang command, like so:

#!"c:program filespython 3.5python.exe"

这篇关于通过 pip 安装 pyinstaller 导致“无法创建进程"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆