Python Forum
setting correct path for P2 after uninstalling Py 3
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
setting correct path for P2 after uninstalling Py 3
#1
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!
Reply
#2
You can use python -m pip install instead of pip install
Reply
#3
Hi thank you! That worked.
Reply
#4
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:\>
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Issue with uninstalling Python that is driving me crazy traxus 0 203 Mar-30-2024, 04:37 PM
Last Post: traxus
  WebDriverException: Message: 'PATH TO CHROME DRIVER' executable needs to be in PATH Led_Zeppelin 1 2,203 Sep-09-2021, 01:25 PM
Last Post: Yoriz
  Uninstalling python 3.8.0a1 arcy 0 1,756 Nov-24-2019, 08:47 PM
Last Post: arcy
  .pth file does not show up in sys.path when configuring path. arjunsingh2908 2 5,741 Jul-03-2018, 11:16 AM
Last Post: arjunsingh2908
  Why Xpath is not selecting the correct path Prince_Bhatia 0 2,063 Sep-19-2017, 05:36 AM
Last Post: Prince_Bhatia

Forum Jump:

User Panel Messages

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