Search code examples
python-3.xinstallationpip

Python installation getting pip Fatal error in launcher: Unable to create process using


I am using Windows 11. I uninstalled python 3.9 and installed python 3.12 (Windows installer (64-bit)). I checked the box add python.exe to path. As part the procedures' I was able to change the environmental variable of "path" to include

  • C:\Users...\Programs\Python\Python312\Scripts\
  • C:\Users...\Programs\Python\Python312\

I have another variable "pip" with value of

  • C:\Users...\Programs\Python\Python312\Scripts\pip.exe

in command prompt

I enter > python --version I get Python 3.12.1 in response.

I entered py get-pip.py and I get the message Successfully installed pip-23.3.1

I enter > pip freeze and I get

Fatal error in launcher: Unable to create process using '"C:\Users...\Programs\Python\Python39\python.exe"  "C:\Users...\Programs\Python\Python39\Scripts\pip.exe" freeze': The system cannot find the file specified.

I already changed environmental variable, what do I need to do?


Solution

  • In the Command Prompt type in

    $ which -a pip

    If the files were not changed then the response should be two file locations:

    /c/Users/.../Programs/Python/Python39/Scripts/pip /c/Users/.../Programs/Python/Python312/Scripts/pip

    Rename or remove the folder Python39 This will this will force pip to use the new folder location.

    for additional details / solutions Pip shows wrong path