Fatal error in launcher: Unable to create process using ""C:\Program Files (x86)\Python33\python.exe" "C:\Program Files (x86)\Python33\pip.exe""

PythonPip

Python Problem Overview


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 ?

Python Solutions


Solution 1 - Python

it seems that

python -m pip install XXX 

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

Solution 2 - Python

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

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)\Python33\python.exe"

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

#!C:\Progra~2\Python33\python.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.

Solution 3 - Python

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

So I made (for example)

python -m pip install virtualenv

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

Solution 4 - Python

>python -m pip

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

Solution 5 - Python

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.

Solution 6 - Python

Here's how I solved it:

  1. open pip.exe in 7zip and extract __main__.py to Python\Scripts folder.

In my case it was C:\Program Files (x86)\Python27\Scripts

  1. Rename __main__.py to pip.py

  2. Run it! python pip.py install something

EDIT:

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

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

  2. make C:\Program Files (x86)\Python27\pip.bat with the following contents:

> python "C:\Program Files (x86)\Python27\Scripts\pip2.py" %1 %2 %3 %4 > %5 %6 %7 %8 %9

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

  2. Run it! pip install something

Solution 7 - Python

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.

Solution 8 - Python

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

Solution 9 - Python

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:])

Solution 10 - Python

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.

Solution 11 - Python

This can happen if you are using a case-sensitive file system on Windows. You can tell if this is the case if there is both a lib directory and a Lib directory in your venv directory :

> dir

Directory: C:\git\case\sensitive\filesystem\here\venv

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        4/07/2018   4:10 PM                Include
d-----       22/01/2019   7:52 AM                Lib
d-----       22/01/2019   7:52 AM                lib
d-----       22/01/2019   7:52 AM                Scripts
d-----       22/01/2019   7:52 AM                tcl

To workaround this (until virtualenv.py gets fixed: https://github.com/pypa/virtualenv/issues/935) merge the two lib directories and make venv case-insensitive:

cd venv
move Lib rmthis
move .\rmthis\site-packages\ lib
rmdir rmthis
fsutil.exe file setCaseSensitiveInfo . disable

Solution 12 - Python

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

Solution 13 - Python

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.

Solution 14 - Python

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:\Python27\Scripts\pip.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)\Python27\Scripts\pip.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.

  1. D:\Program Files (x86)\Python27\Scripts\pip.exe install -r requirements.txt

  2. "D:\Program Files (x86)\Python27\Scripts\pip.exe install -r requirements.txt" Python27\Scripts\pip.exe install -r requirements.txt

  3. "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.

Solution 15 - Python

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:\Python27\Scripts edit django-admin.exe to django-admin27.exe so it done

Solution 16 - Python

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

Solution 17 - Python

On Windows I had solved this problem in the following way :

  1. uninstalled Python

  2. navigated to C:\Users\MyName\AppData\Local\Programs(your should turn on hidden files visibility Show hidden files instruction)

  3. deleted 'Python' folder

  4. installed Python

Solution 18 - Python

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.

Solution 19 - Python

Here is how i fixed it.

  1. Download https://bootstrap.pypa.io/get-pip.py
  2. Active your vitualenv
  3. Navigate to the get-pip.py file and type "python get-pip.py" without quote.

it will reinstall your pip within the environment and uninstall the previous version automatically.

now boom!! install whatever you like

Solution 20 - Python

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.

Solution 21 - Python

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.

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.

Solution 22 - Python

I had this issue and the other fixes on this page didn't fully solve the problem.

What did solve the problem was going in to my system environment variables and looking at the PATH - I had uninstalled Python 3 but the old path to the Python 3 folder was still there. I'm running only Python 2 on my PC and used Python 2 to install pip.

Deleting the references to the nonexistent Python 3 folders from PATH in addition to upgrading to the latest version of pip fixed the issue.

Solution 23 - Python

I had a simpler solution. Using @apple way but rename main.py to pip.py then put it in your python version scripts folder and add scripts folder to your path access it globally. if you don't want to add it to path you have to cd to scripts and then run pip command.

Solution 24 - Python

I have similar problem when I reinstall my python, by uninstalling python3.7 and installing python3.8. But I solved it by removing the previous version of python directory. For me it was located here,

> C:\Users\your-username\AppData\Local\Programs\Python

I deleted the folder named Python37 (for previous version) and keep Python38 (for updated version). This worked because python itself seems having a trouble on finding the right directory for your python scripts.

Solution 25 - Python

I was trying to install some site-packages like numpy, xgboost and so on, but this error showed up every time:

Fatal error in launcher: Unable to create process using

I've tried many ways to solve this problem and found this one, that successfully helped me:

python -m pip freeze

Hope it'll help someone too.

P.S. I found this solution here: https://stackoverflow.com/a/39733705/10310794

Solution 26 - Python

You can remove previous python folder and also environment variable path from you pc then Reinstall python .it will be solve

Solution 27 - Python

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

$ python "full path to ipython.exe"

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionArcView Question on Stackoverflow
Solution 1 - Pythonuser4154243View Answer on Stackoverflow
Solution 2 - PythonArcView Answer on Stackoverflow
Solution 3 - PythonMiguelCldnView Answer on Stackoverflow
Solution 4 - PythonJoel K ThomasView Answer on Stackoverflow
Solution 5 - PythonJohan GovView Answer on Stackoverflow
Solution 6 - Pythonapple16View Answer on Stackoverflow
Solution 7 - PythonPierre CarbonnelleView Answer on Stackoverflow
Solution 8 - PythonDevView Answer on Stackoverflow
Solution 9 - PythonkrrrView Answer on Stackoverflow
Solution 10 - PythonBadr BellajView Answer on Stackoverflow
Solution 11 - PythoncdjcView Answer on Stackoverflow
Solution 12 - PythonSamik BanerjeeView Answer on Stackoverflow
Solution 13 - PythonMarkus WeberView Answer on Stackoverflow
Solution 14 - PythonAjay2707View Answer on Stackoverflow
Solution 15 - PythondecemerView Answer on Stackoverflow
Solution 16 - PythonNorman PilusaView Answer on Stackoverflow
Solution 17 - PythondarksideView Answer on Stackoverflow
Solution 18 - PythonRiki137View Answer on Stackoverflow
Solution 19 - PythonMahabub RahmanView Answer on Stackoverflow
Solution 20 - PythonM.S. ArunView Answer on Stackoverflow
Solution 21 - PythonMrClanView Answer on Stackoverflow
Solution 22 - PythonAxesiloView Answer on Stackoverflow
Solution 23 - PythonSahib KhanView Answer on Stackoverflow
Solution 24 - PythonKingView Answer on Stackoverflow
Solution 25 - PythonRoman VoytView Answer on Stackoverflow
Solution 26 - Pythonuser8099291View Answer on Stackoverflow
Solution 27 - PythonStephen KimView Answer on Stackoverflow