Installing pyinstaller via pip leads to “failed to create process”

后端 未结 9 2264
时光说笑
时光说笑 2020-12-01 16:23

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

I installed pyinstaller via

9条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-01 16:36

    [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"
    

提交回复
热议问题