pip/easy_install failure: failed to create process

It will help after changing the PATH to python in environment variables:

python -m pip install --upgrade pip --force-reinstall


Just ran into this. Sort of. Pip worked for me, but after installing pytest-watch, running the ptw script was giving this error.

For some reason, pip stopped quoting the #! in ptw-script.py:

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

It worked after I added quotes manually:

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

I don't really know why this suddenly started happening. Adding this here in case anyone else coming here from Google runs into the same thing.

Here's a related pip issue (I think).


When I encountered this, it was because I'd manually renamed the directory python was in. This meant that both setuptools and pip had to be reinstalled. Or, I had to manually rename the python directory to what it had been previously.


If you intentionally want to rename the folder where python.exe resides, you should also modify all python files in the Scripts folder. So a third solution would be to modify the python files as well: the first line in pip-2.7-script.py originally contain:

#!C:\OriginalPythonDir\python.exe

Modifying this path to the new Python folder fixes the problem.

(P.S. Unfortunately I cannot yet reply to answers, so I'll reply as a new answer because I thought it could be useful for other people as well).