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

后端 未结 9 2237
时光说笑
时光说笑 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:25

    "C:\Program Files\Python35-32\python.exe" "C:\Program Files\Python35-32\Scripts\pyinstaller-script.py" --onefile --windowed ex_btn.py

    --onefile : create only exe, --windowed : exclude the prompting CMD, ex_btn.py : python script file.

    This worked like charm.

    0 讨论(0)
  • 2020-12-01 16:26

    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.

    0 讨论(0)
  • 2020-12-01 16:26

    In my case, I uninstall and install pyinstaller, then every things work well.

    It may relate to any changes within python after installation, so re-installing is a good choice.

    uninstall:

    pip uninstall pyinstaller
    

    install:

    pip install pyinstaller
    
    0 讨论(0)
  • 2020-12-01 16:27

    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
    
    0 讨论(0)
  • 2020-12-01 16:27

    I had the same issue, even with pip and setuptools updated, and the problem was that pyinstaller-script.py, found in C:\Python35\Scripts\ directory, had the wrong path for python.exe.

    Python on my system was somehow installed in AppData, but its' scripts and modules were being installed in C:\Python35\ folder.

    Changing the first line of pyinstaller-script.py to the correct path of python.exe (Programs directory inside AppData), with quotes if there's any space in the folders' names inbetween, and it should work and no longer show the "Failed to create process". Example:

    #!C:\Program" "Files" "(x86)\Python\python.exe
    

    Using Windows10 and Python35 official installer got Python installed there somehow.

    0 讨论(0)
  • 2020-12-01 16:32

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

    0 讨论(0)
提交回复
热议问题