how to run a virtual environment python code example

Example 1: creating virtual environment python

python3 -m venv tutorial-env
#name : tutorial-env
tutorial-env\Scripts\activate 	#activate env
deactivate #deactivate env

Example 2: how to use virtual environment python

python3 -m venv env

Example 3: how to use virtual environment python

python3 -m pip install --user virtualenv

Example 4: how to create a virtual environment in python

source env/bin/activate

Example 5: how to make a virtual environment in python

.\env\Scripts\activate

Example 6: how to activate python virtual environment

#open directory with terminal where you crated vertual environment
#example your venv name <visualscrapy>
teamspirit:~$ cd visualscrapy
#teamspirit:~/visualscrapy$  <-- output
#Now type bellow command
source ./bin/activate
#(visualscrapy) teamspirit:~/visualscrapy$   <-- output