Fatal error in launcher: Unable to create process using “”C:Program Files (x86)Python33python.exe“ ”C:Program Files (x86)Python33pip.exe“”


Fatal error in launcher: Unable to create process using “”C:Program Files (x86)Python33python.exe“ ”C:Program Files (x86)Python33pip.exe“”



Searching the net this seems to be a problem caused by spaces in the Python installation path.



How do I get pip to work without having to reinstall everything in a path without spaces ?


pip





Have you tried using short path names for program files(X86)? e.g. "C:PROGRA~2Python33python.exe"
– Shadow9043
Jul 8 '14 at 8:55





The problem is that when pip is installed, it will use the original, long name it gets from the system. See my answer below.
– Archimedix
Jul 9 '14 at 9:57


pip





Reproducable with Python 2.7 and Windows 10 Preview build 10074
– Csaba Toth
May 7 '15 at 23:32





@CsabaToth, I have to correct your edit: The double quotes were correct as they were before your change; they were just omitting the single quotes: The verbatim error is: Fatal error in launcher: Unable to create process using '""C:Program Files (x86)Python33python.exe"" "C:Program Files (x86)Python33Scriptspip.exe" '. Looks strange, but it's the way it is.
– Archimedix
May 25 '15 at 5:35


Fatal error in launcher: Unable to create process using '""C:Program Files (x86)Python33python.exe"" "C:Program Files (x86)Python33Scriptspip.exe" '





Problem still exists in Python3.5. I wonder whether the community has done anything for this.
– laike9m
Oct 21 '15 at 11:32




20 Answers
20



it seems that


python -m pip install XXX



will work anyway (worked for me)
(see link by user474491)





Made it the accepted answer, though it's more of a workaround (or alternative approach) than an actual fix, but anyways, it is more universally applicable.
– Archimedix
Jan 16 '15 at 14:31





@user4154243, that works, but can you explain what it actually does? Are there consequences using that to install every other library?
– multigoodverse
Sep 22 '15 at 8:34





you save me, I was trying to configure oddo and its need to configure python. I was try 5 6 hrs for the same issue, finally its work from your idea. big thanks. I also add my answer for oddo related work.
– Ajay2707
Nov 27 '15 at 6:41






Had this issue in a virtualenv, used your solution to install the latest pip, which then allowed use of the command normally: python -mpip install pip --upgrade
– tr00st
Dec 1 '15 at 15:59






this is a workaround and should not be the accepted answer
– Raiden Core
Jun 28 '16 at 16:40



On Windows at least, pip stores the execution path in the executable pip.exe when it is installed.


pip


pip.exe



Edit this file using a hex editor or WordPad (you have to save it as plain text then to retain binary data), change the path to Python with quotes and spaces like this:


#!"C:Program Files (x86)Python33python.exe"



to an escaped path without spaces and quotes and pad with spaces (dots at the end should be spaces):


#!C:Progra~2Python33python.exe.............



For "C:Program Files", this path would probably be "C:Progra~1" (shortened path names in DOS / Windows 3.x notation use tilde and numbers).
Windows provides this alternative notation for backwards compatibility with DOS / Windows 3.x apps.



Note that as this is a binary file, you should not change the file size which may break the executable, hence the padding.



Save with administrator privileges, make sure it is actually saved at the target location and try again.



You might also need to set the PATH variable to use the ~ notation for the path to pip.


PATH


~


pip





I did not mean the environment variable. I only meant where this string appeared "#!"C:Program Files (x86)Python33python.exe" I was able to find out where it was though using a hex editor. However using Sublime Text no such string was visible. Can you think of any reason why the path is shown in Wordpad and not in Sublime Text?
– Sohaib
Jul 31 '14 at 11:22



"#!"C:Program Files (x86)Python33python.exe"





WordPad is a dumb text editor, Sublime is probably too smart and shows a hex dump of the contents, I guess.
– Archimedix
Jul 31 '14 at 13:09





This worked for me. My original string was #!"C:Program FilesPython3.4python.exe", so I changed it to #!C:Progra~1Python3.4python.exe and it worked. I was able to edit the file fine with Notepad++. This string shows up near the end of the file, at the end of a long line.
– Scott Weldon
Jul 31 '14 at 20:04



#!"C:Program FilesPython3.4python.exe"


#!C:Progra~1Python3.4python.exe





Good and functional workaround. But it is important to note that the dots after the path are NULL chars (00 in hex) and that the size of the file should not be changed.
– Diego Queiroz
Oct 16 '14 at 0:55





This worked. I simply uninstalled python. Then reinstalled; upon reinstall, I just changed the install folder from C:Program Files (x86)Python34 to be C:Progra~2Python34. (if you do not wish to deal with a hex editor or changing a binary file)
– Trent
Jan 9 '15 at 6:06



C:Program Files (x86)Python34


C:Progra~2Python34



having the same trouble I read in https://pip.pypa.io/en/latest/installing.html#install-pip that to update pip it's:



python -m pip install -U pip


python -m pip install -U pip



So I made (for example)



python -m pip install virtualenv


python -m pip install virtualenv



And it worked! So you can do the same being 'virtualenv' another package you want.





I was suffering from the error listed and this was the solution that worked for me! I was even able to use 'pip install virtualenv' and stop using 'python -m pip' after making the upgrade to latest pip. Thanks!
– steve-gregory
Jan 30 '15 at 6:21



python -m pip



really works for the problem Fatal error in launcher: Unable to create process using '"'.Worked on Windows 10


Fatal error in launcher: Unable to create process using '"'



Here's how I solved it:



open pip.exe in 7zip and extract __main__.py to PythonScripts folder.


pip.exe


__main__.py



In my case it was C:Program Files (x86)Python27Scripts


C:Program Files (x86)Python27Scripts



Rename __main__.py to pip.py


__main__.py


pip.py



Run it! python pip.py install something


python pip.py install something



EDIT:



If you want to be able to do pip install something from anywhere, do this too:


pip install something



rename pip.py to pip2.py (to avoid import pip errors)



make C:Program Files (x86)Python27pip.bat with the following contents:


C:Program Files (x86)Python27pip.bat



python "C:Program Files (x86)Python27Scriptspip2.py" %1 %2 %3 %4
%5 %6 %7 %8 %9



add C:Program Files (x86)Python27 to your PATH (if is not already)


C:Program Files (x86)Python27



Run it! pip install something


pip install something



This is a known Bug when there is a space in the virtualenv path. Correction has been made, and will be available in the next version.


virtualenv





The Pip bug HAS now been fixed. Update by running python -m pip install -U pip
– StuartLC
Dec 26 '14 at 15:38


python -m pip install -U pip





No, as of now, Python34 , still has the bug!
– Martin F
Mar 11 '15 at 21:56





Still an issue...
– enzi
Feb 20 at 7:51



I had a similar issue and upgrading pip fixed it for me.


python -m pip install --upgrade pip



This was on Windows and the path to python inside pip.exe was incorrect. See Archimedix answer for more information about the path.



I had the same issue on windows 10, after trying all the previous solution the problem persists so I decided to uninstall my python 2.7 and install the version 2.7.13 and it works perfectly.



i solve my problem in Window
if u install both python2 and python3



u need enter someone Scripts change all file.exe to file27.exe,then it solve



my D:Python27Scripts edit django-admin.exe to django-admin27.exe so it done





Welcome to SO. Please look up formatting your answer in the help section.
– Richard Erickson
Apr 6 '16 at 16:07




My exact problem was (Fatal error in launcher: Unable to create process using '"') on windows 10. So I navigated to the "C:Python33Libsite-packages" and deleted django folder and pip folders then reinstalled django using pip and my problem was solved.



I wrote a script to patch those exe. But the best way is to fix distutil itself.


"""Fix "Fatal error in launcher: Unable to create process using ..." error. Put me besides those EXE made by pip. (They are made by distutils, and used by pip)"""
import re
import sys
import os
from glob import glob


script_path = os.path.dirname(os.path.realpath(__file__))
real_int_path = sys.executable
_t = script_path.rpartition(os.sep)[0] + os.sep + 'python.exe'
if script_path.lower().endswith('scripts') and os.path.isfile(_t):
real_int_path = _t

print('real interpreter path: ' + real_int_path)
print()

for i in glob('*.exe'):
with open(i, 'rb+') as f:
img = f.read()
match = re.search(rb'#![a-zA-Z]:.+.exe', img)
if not match:
print("can't fix file: " + i)
continue
int_path = match.group()[2:].decode()
int_path_start = match.start() + 2
int_path_end = match.end()

if int_path.lower() == real_int_path.lower():
continue
print('fix interpreter path: %s in %s' % (int_path, i))
f.seek(int_path_start)
f.write(real_int_path.encode())
f.write(img[int_path_end:])





I had the error "Unable to create process" when I tried to run eb.exe (part of AWS Elastic Beanstalk CLI) and this little script fixed eb.exe! It works now, thanks.
– JustAC0der
Dec 8 '17 at 8:25





This worked for me but only after changing the code to match the length from the real_int_path with the int_path. I padded it with spaces as suggested by the answer from Archimedix.
– lou
Jun 5 at 10:51



I renamed the executable of python.exe to e.g. python27.exe. In respect to the answer of Archimedix I opened my pip.exe with a Hex-Editor, scrolled to the end of the file and changed the python.exe in the path to python27.exe. While editing make shure you don't override other informations.


python.exe


python27.exe


python.exe


python27.exe



Try reinstall by using the below link,



Download https://bootstrap.pypa.io/get-pip.py



After download, copy the "get-pip.py" to python installed main dirctory, then open cmd and navigate to python directory and type "python get-pip.py" (without quotes)



Note: Also make sure the python directory is set in the environmental variable.



Hope this might help.



On windows I solved this problem a little complex way :



1) Uninstalled Python



2) went to C:UsersMyNameAppDataLocalPrograms(your should turn on hidden files visibility Show hidden files instruction)


C:UsersMyNameAppDataLocalPrograms



3)deleted 'Python' folder



4) installed Python





I am on Windows 10. I copied the python folder and overwrite to a new computer to save the time from installing everything of over 800 MBytes. This worked fine before, but somehow not this time. I tried everything here, only Darkside's ultimate solution works for me.
– H.C.Chen
May 17 at 4:50





it's works for me!
– Mike Chan
Jun 1 at 14:28



For me this problem appeared when I changed the environment path to point to v2.7 which was initially pointing to v3.6. After that, to run pip or virtualenv commands, I had to python -m pip install XXX as mentioned in the answers below.


python -m pip install XXX



So, in order to get rid of this, I ran the v2.7 installer again, chose change option and made sure that, add to path option was enabled, and let the installer run. After that everything works as it should.



I have chosen to install Python for Windows (64bit) not for all users, but just for me.



Reinstalling Python-x64 and checking the advanced option "for all users" solved the pip problem for me.



i had same issue and did a pip upgrade using following and now it works fine.
python -m pip install --upgrade pip


python -m pip install --upgrade pip



Please add this address :



C:Program Files (x86)Python33



in Windows PATH Variable



Though first make sure this is the folder where Python exe file resides, then only add this path to the PATH variable.



To append addresses in PATH variable, Please go to



Control Panel -> Systems -> Advanced System Settings -> Environment
Variables -> System Variables -> Path -> Edit ->



Then append the above mentioned path & click Save



I added my anwer because I have getting the same error while configure ODDO9 source code in local and its need the exe to run while run exe, I got the same error.



From yesterday I was configure oddo 9.0 (section :- "Python dependencies listed in the requirements.txt file.") and its need to run PIP exe as



C:YourOdooPath> C:Python27Scriptspip.exe install -r requirements.txt



My oddo path is :- D:Program Files (x86)Odoo 9.0-20151014
My pip location is :- D:Program Files (x86)Python27Scriptspip.exe



So I open command prompt and go to above oddo path and try to run pip exe with these combination, but not given always above error.



"D:Program Files (x86)Python27Scriptspip.exe install -r requirements.txt"
Python27Scriptspip.exe install -r requirements.txt



"Python27/Scripts/pip.exe install -r requirements.txt"



I resolved my issue by the @user4154243 answer, thanks for that.



Step 1: Add variable(if your path is not comes in variable's path).



Step 2: Go to command prompt, open oddo path where you installed.



Step 3: run this command python -m pip install XXX will run and installed the things.


python -m pip install XXX



Instead of calling ipython directly, it is loaded using Python such as



$ python "full path to ipython.exe"




Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).


Would you like to answer one of these unanswered questions instead?

Popular posts from this blog

api-platform.com Unable to generate an IRI for the item of type

How to set up datasource with Spring for HikariCP?

Display dokan vendor name on Woocommerce single product pages