Python Forum
Installation with path variable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Installation with path variable
#1
Hi,
I want to install tw versions of python on my PC and to be able to select which I want

That's why when I install python 2.7.15 I specifiy a location based on variable : C:\Logiciels\Python_%PYTHON_VERSION%\ where PYTHON_VERSION=2-7.
At the end Python is correctly installed in c:\Logiciels\Python_2-7


in the registry al the path have refer to C:\Logiciels\Python_%PYTHON_VERSION%\



When I install version 3.7.2 I tried to make the same thing. I set a variable PYTHON_VERSION with the value 3-7
In the location Folder I set : C:\Logiciels\Python_%PYTHON_VERSION%\

The installation failed and I found a Folder C:\Logiciels\Python_3-7 and a folder C:\Logiciels\Python_%PYTHON_VERSION%\ this folder contains a folder Lib with 28 subfolders and a folder Tools with five subfolders.


If I coud install 3.7.2 as I've installed 2.7.15 I would be able to choose the version just by changing the value of the variable PYTHON_VERSION

Thank you for analyzing this problem.

Best regards

Philippe C.
Sorry for my english ..
Reply
#2
Follow Python 3.6/3.7 and pip installation under Windows
Look last in post Access other versions.
So Python 3.7 will be main version in Path,access to 2.7 you use py.
From cmd:
Microsoft Windows [Version 10.0.17134.523]
(c) 2018 Microsoft Corporation. Med enerett.

C:\Windows\System32>cd\

# Main version in Path
C:\>python -V
Python 3.7.0

# Test pip
C:\>pip -V
pip 19.0.2 from c:\python37\lib\site-packages\pip (python 3.7)

# Access 2.7 
C:\>py -2.7 -V
Python 2.7.9

# Run file with python 2.7
C:\>py -2.7 my_code.py

# Using pip to install to 2.7                                                                            
C:\> py -2.7 -m pip install logzero                                                                               
Reply


Forum Jump:

User Panel Messages

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