pythonpipcpplint

How to get Python packages installed as .exe to run on Windows 10; "failed to create process"


After installing Python 3.5.1 on Windows 10 x64, cpplint installed from pip produces the error: failed to create process. There seems to be a possibly related issue with pip related to having a space in the path, which exists in my use case. It seems to be related to how the exe is created. How can this error be remedied? Reinstalling Python and cpplint does not solve the problem.

C:\Users>python -V
Python 3.5.1

C:\Users>pip list
pip (7.1.2)
setuptools (18.2)

C:\Users>pip -V
pip 7.1.2 from c:\users\john hagen\appdata\local\programs\python\python35\lib\site-packages (python 3.5)

C:\Users>pip install cpplint
Collecting cpplint
  Using cached cpplint-0.0.6.tar.gz
Installing collected packages: cpplint
  Running setup.py install for cpplint
Successfully installed cpplint-0.0.6

C:\Users>where.exe cpplint
C:\Users\John Hagen\AppData\Local\Programs\Python\Python35\Scripts\cpplint.exe

C:\Users>cpplint
failed to create process.

Solution

  • Yep, this is a pip bug.

    The workaround is to add quotes around the path in the first line of generated python scripts in the \Scripts\ directory. In the case of cpplint this is 'cpplint-script.py'. In your case the generated first line should something like:

    #!c:\users\john hagen\appdata\local\programs\python\python35\python.exe
    

    and should be edited to:

    #!"c:\users\john hagen\appdata\local\programs\python\python35\python.exe"