Python Forum

Full Version: setting correct path for P2 after uninstalling Py 3
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I installed Python 3.7 recently but discovered a script I can use which runs on Python 2.7. I read through several sets of instructions on how to run both versions on the same machine, but I also saw lots of disagreement as to what works and what doesn't.

So I uninstalled 3.7 (which was installed to the programs folder in Win 10) and cleaned my machine as best I could of any reference to 3.7.

Then reinstalled 2.7 in the C:\Python27 folder. That went fine. Next step was to install pip, so this is what happened:

C:\Python27>python get-pip.py
Requirement already up-to-date: pip in c:\python27\lib\site-package
Then I tried to use
pip install
to install some modules, but I get this:
'pip' is not recognized as an internal or external command,
operable program or batch file
.

Any advice? Thanks!
You can use python -m pip install instead of pip install
Hi thank you! That worked.
You should have Python 3.6 as main version set in Path.
Because Python 3 is what you should learn.
Follow Python 3.6 and pip installation under Windows, part-2

There no problem to have Python 2.7 install to.
Python 3.6 install a py.exe into Windows folder,
this py can be used to access all version installed.

So then it look like this python and pip point to 3.6,and other version is accessed trough py.
Microsoft Windows [Version 10.0.16299.192]
(c) 2017 Microsoft Corporation. Med enerett.

C:\WINDOWS\system32>cd\

C:\>python
Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()

C:\>pip -V
pip 9.0.1 from c:\python36\lib\site-packages (python 3.6)

# Access 2.7
C:\>py -2.7
Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()

# Access 3.4
C:\>py -3.4 -V
Python 3.4.2

# Access 3.5
C:\>py -3.5 -V
Python 3.5.2

# Install to 2.7
C:\>py -2.7 -m pip install tabulate
Collecting tabulate
  Using cached tabulate-0.8.2.tar.gz
Installing collected packages: tabulate
  Running setup.py install for tabulate ... done
Successfully installed tabulate-0.8.2

# Just pip will install to main version 3.6
C:\>pip install tabulate
Collecting tabulate
Installing collected packages: tabulate
Successfully installed tabulate-0.8.2

C:\>