5/12/2020

Python - How to Set the Path and Switch Between Different Versions/Executables (Windows)

** How to Set the Path and Switch Between Different Versions/Executables (Windows)

==========================================

>>> import sys

>>> sys.executable
'C:\\Users\\purunet\\AppData\\Local\\Programs\\Python\\Python38-32\\python.exe'

---------------------------------

C:\Users\purunet>echo %path%

C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\Wind
owsPowerShell\v1.0\;C:\MinGW\bin;C:\Users\purunet\AppData\Local\Programs\Python\
Python38-32\Scripts\;C:\Users\purunet\AppData\Local\Programs\Python\Python38-32\

---------------------------------

C:\Users\purunet>pip install django
Collecting django
  Downloading Django-3.0.6-py3-none-any.whl (7.5 MB)
     |████████████████████████████████| 7.5 MB 67 kB/s
Collecting sqlparse>=0.2.2
  Downloading sqlparse-0.3.1-py2.py3-none-any.whl (40 kB)
     |████████████████████████████████| 40 kB 107 kB/s
Collecting asgiref~=3.2
  Downloading asgiref-3.2.7-py2.py3-none-any.whl (19 kB)
Requirement already satisfied: pytz in c:\users\purunet\appdata\local\programs\p
ython\python38-32\lib\site-packages (from django) (2020.1)
Could not build wheels for pytz, since package 'wheel' is not installed.
Installing collected packages: sqlparse, asgiref, django
Successfully installed asgiref-3.2.7 django-3.0.6 sqlparse-0.3.1

---------------------------------

C:\Users\purunet>pip install wheel
Collecting wheel
  Downloading wheel-0.34.2-py2.py3-none-any.whl (26 kB)
Installing collected packages: wheel
Successfully installed wheel-0.34.2

---------------------------------

C:\Users\purunet>pip install django
Requirement already satisfied: django in c:\users\purunet\appdata\local\programs
\python\python38-32\lib\site-packages (3.0.6)
Requirement already satisfied: pytz in c:\users\purunet\appdata\local\programs\p
ython\python38-32\lib\site-packages (from django) (2020.1)
Requirement already satisfied: sqlparse>=0.2.2 in c:\users\purunet\appdata\local
\programs\python\python38-32\lib\site-packages (from django) (0.3.1)
Requirement already satisfied: asgiref~=3.2 in c:\users\purunet\appdata\local\pr
ograms\python\python38-32\lib\site-packages (from django) (3.2.7)

---------------------------------

C:\Users\purunet>pip show django
Name: Django
Version: 3.0.6
Summary: A high-level Python Web framework that encourages rapid development and
 clean, pragmatic design.
Home-page: https://www.djangoproject.com/
Author: Django Software Foundation
Author-email: foundation@djangoproject.com
License: BSD
Location: c:\users\purunet\appdata\local\programs\python\python38-32\lib\site-pa
ckages
Requires: pytz, asgiref, sqlparse
Required-by:

---------------------------------

==========================================

import sys

print(sys.version)
print(sys.executable)

---------------------------------

3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 22:45:29) [MSC v.1916 32 bit (Intel)]
C:\Users\purunet\AppData\Local\Programs\Python\Python38-32\python.exe

---------------------------------