1pip install virtualenv
2cd projectfolder #go to project folder
3virtualenv projectname #create the folder projectname
4source projectname/bin/activate
1python3 -m venv tutorial-env
2#name : tutorial-env
3tutorial-env\Scripts\activate #activate env
4deactivate #deactivate env
1Create Virtual Environment
2
3 1. Install "vitrualenv" packages globally
4
5python3 -m pip install virtualenv
6
7Check installed version : virtualenv -V
8
9 2. Create a directory for your Virtual Environments
10
11Mkdir VirtialEnv
12
13 3. Move to this direcory
14
15 Cd VirtialEnv
16
17 4. Create your python virtual environment
18
19 virtualenv {name of your venv}
20 virtualenv myvenv
21 virtualenv myvenv -p python3
22
23 5. Activate virtual env
24 . Myvenv/bin/activate
25
26 /myvenv/bin/activate.bat (Windows)
27
28 6. Now your terminal is using this Virtual environment for your python project
29
30 Check python version
31
32 pythoon -V
33
34 7. After done your work you need to deactivate you Virtual env
35
36deactivate