📚 Tutorial🐍 Python1.2 Install and Config venv (Windows)

Install with venv

Install and Config Python with venv instead of conda env.

- 1. Download

Download the regarding python version from:
https://www.python.org/downloads/

- 2. Windows Create venv

Set the windows Set-ExecutionPolicy if occur the policy issues.

powershell as administrator
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned

Select verison to install

If your windows installed more than one python, you may use the absolute path to install specific version.

python -m venv <env_name>
 
C:\Users\<username>\AppData\Local\Programs\Python\Python39\python.exe -m venv myenv
C:\Users\<username>\AppData\Local\Programs\Python\Python310\python.exe -m venv myenv
C:\Users\<username>\AppData\Local\Programs\Python\Python38\python.exe -m venv tfv

Activite env

If you are using powershell, you may use the following line to active the environment.

myenv\Scripts\Activate.ps1

Upgrade pip

python -m pip install --upgrade pip
 
C:\Users\username\AppData\Local\Programs\Python\Python38\python.exe -m pip install --upgrade pip

Exit env

deactivate