Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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

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)

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

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.

Any insight anyone? #windowsfrustrations Path C:\Users\me\Anaconda\Lib\site-packages>PyInstaller

like image 246
phillipsK Avatar asked Aug 04 '15 11:08

phillipsK


4 Answers

[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.]

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.

Specifically it leaves out quote marks in the generated launcher scripts. The scripts can be found in \Scripts\ (e.g. C:\Program Files\Python 3.5\Scripts). 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 files\python 3.5\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'PyInstaller==3.1.1','console_scripts','pyinstaller'

Just add quotes around the shebang command, like so:

#!"c:\program files\python 3.5\python.exe"
like image 76
Janzert Avatar answered Oct 24 '22 20:10

Janzert


This error seems to occur when Python’s (or PyInstaller’s) path contains a space (for example, when one installs Python to the Program Files (x86) directory.)

I suspect that somewhere in PyInstaller’s source code there are some missing quotation marks.

Try installing Python in a path without spaces, and installing PyInstaller (via pip) to that path.

like image 21
AthanasiusOfAlex Avatar answered Oct 24 '22 20:10

AthanasiusOfAlex


As StationaryTraveller mentioned, you can work around this bug by calling script pyinstaller-script.py

Below is an example

C:>"C:\Program Files (x86)\Python35-32\python.exe" "C:\Program Files (x86)\Python35-32\Scripts\pyinstaller-script.py" script_to_compile.py
like image 42
Guillaume Jacquenot Avatar answered Oct 24 '22 18:10

Guillaume Jacquenot


As of July 2016 the issue was reported as fixed, ugrading pip, setuptools and then uninstalling and installing pyinstaller should remedy the problem

like image 39
Harald Scheirich Avatar answered Oct 24 '22 18:10

Harald Scheirich