Python Forum
python 3 and python 2 pips not working in windows
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python 3 and python 2 pips not working in windows
#1
hello i installed python3 and want in windows that when i type python3 it calls python3 and just python it calls python 2 cause i installed cocos2dx framework which needs the default python to be python 2 i followed this guide https://medium.com/@ryanmillerc/install-...4287708429 but then when i type pip3 or pip i get the following error Fatal error in launcher: Unable to create process using ‘“c:\users\gustx\appdata\local\programs\python\python37\python.exe” “C:\Users\gustx\AppData\Local\Programs\Python\Python37\Scripts\pip3.exe”
pip
‘“c:\users\gustx\appdata\local\programs\python\python37\python.exe” “C:\Users\gustx\AppData\Local\Programs\Python\Python37\Scripts\pip.exe” anyone know how to fix this and make pip work again
Reply
#2
That's link is not the ideal way of doing this.
Just use py to access all other version installed.
Then there is no need to mess with or rename python.exe.
Explain all in here also usage of py Python 3.6/3.7 and pip installation under Windows

python and pip use the main most used version.
E:\div_code
λ python -V
Python 3.7.3

E:\div_code
λ pip -V
pip 19.2.1 from c:\python37\lib\site-packages\pip (python 3.7) 
Use other version.
E:\div_code
λ py -2.7 -V
Python 2.7.9

E:\div_code
λ py -3.4 -V
Python 3.4.2

E:\div_code
λ py -3.5 -V
Python 3.5.2

# Install to 2.7
E:\div_code
λ py -2.7 -m pip install requests
Requirement already satisfied: requests in c:\python27\lib\site-packages (2.18.4)
Reply
#3
If this is *your* machine, then do yourself a favor and install Python to C:\Python27 and C:\Python37. Pip is usually in the \pythonxx\scripts directory.

You need to add these to your path. Do this in Conjtrol Panel/System/look for Environment, and use system rather than user settings. C:\Python37;C:\Python37\scripts;C:\Python27;C:\Python27\scripts;

Do yourself a favor and copy Python37.exe to python3.exe and pip.exe to pip3.exe.
And do likewise with Python 2.7 . (Use pip2)

Then in your scripts, at the shebang use:
#!/env python3 for 3.7
#!/env python2 for 2.7

Pip is not a native part of python, and was bolted on much later....

It gets confusing because in many systems, including Debian here, pip will always default to Python 2.x

You can also try experimenting with symlinks to dirs already on your path, but I've run into problems with this on Anaconda.
Reply
#4
(Aug-17-2019, 05:03 PM)millpond Wrote: Do yourself a favor and copy Python37.exe to python3.exe and pip.exe to pip3.exe.
And do likewise with Python 2.7 . (Use pip2)

Then in your scripts, at the shebang use:
#!/env python3 for 3.7
#!/env python2 for 2.7
No this is just wrong,there is no Python37.exe in a Windows install only Python.exe.
As i mention you do not mess or rename anything at all,access to other version in Windows is bye using py.
If you not sure about this then don't give advice that can mess up stuff.
Reply
#5
(Aug-16-2019, 03:58 PM)snippsat Wrote: Just use py to access all other version[s] installed ...
Explain all in here also usage of py Python 3.6/3.7 and pip installation under Windows

This is a pretty poor answer for Windows users:
* install process for python 2 and python 3 affects the [path] environment differently and that is not demonstrated with an answer based on two python 3 versions
* the answer relies on a pretty esoteric piece of code, the Lambda function - something I don't understand or even know how to type, so it hasn't been communicated effectively to me

The issue of using pip with different python versions is common enough from an online search and doesn't seem to have a nice solution. It's something that should be covered in the python docs.

Hmm, maybe the λ (Lambda) is a font issue with the site or an unfortunate choice for a customised python prompt.

(I don't know why posts would be set so they can't be edited after 10 minutes.)

Seems to work but the second command is very slow, presumably because commands are not in the path

C:\Users\User>pip -V
pip 19.3.1 from c:\users\user\appdata\local\programs\python\python38\lib\site-packages\pip (python 3.8)

C:\Users\User>py -2 -m pip -V
pip 19.2.3 from C:\Python27\lib\site-packages\pip (python 2.7)

I think a better approach is to set up a separate environment for each version. My preference is not to add python to the path and just run a batch file to set up the environment for each version before use.
Reply
#6
https://python-forum.io/Thread-Part-2-Py...9#pid18249
Quote:A much better cmd cmder.

wtf - totally confusing with the λ etc, would be more clearly explained it in a vanilla environment
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  I'm new to Python - can someone help with this code as it is not working? lminc123 1 508 Feb-13-2025, 06:13 PM
Last Post: lminc123
  I'm trying to install python 3.11.11 on windows 10 - it doesn't work Petonique 2 1,709 Feb-04-2025, 05:42 PM
Last Post: snippsat
  Python-Kasa stopped working liderbug 1 440 Jan-27-2025, 02:47 PM
Last Post: liderbug
  Python 3.13(Windows) does not have the latest module OS phillip_from_oz 1 819 Dec-13-2024, 04:35 AM
Last Post: deanhystad
  How to re-register .py file extension to new moved Python dir (on Windows)? pstein 5 1,270 Nov-06-2024, 03:06 PM
Last Post: DeaD_EyE
  Trouble Setting Up Selenium with FireFox (Python 3 on Windows 10)) gw1500se 5 5,886 Oct-07-2024, 06:41 PM
Last Post: AlluminumFoil
  get Python working Pedroski55 3 3,022 Aug-04-2024, 05:00 AM
Last Post: Pedroski55
  How to find out from outside Python (in Windows) the current version of Python? pstein 5 2,255 Jun-28-2024, 07:02 AM
Last Post: Samuel34
  Excel isnt working properly after python function is started IchNar 2 1,225 May-01-2024, 06:43 PM
Last Post: IchNar
  Python trivial endgame engine is not working as expected max22 0 1,120 Feb-24-2024, 04:41 PM
Last Post: max22

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020