How to create a virtual environment in python3?
What is virtual environment?
A virtual environment is the environment which differs from the actual installed python and other system environments, which means that you can individually install libraries for the python programs and project in the virtual env and not disturbing the actual system environment.
How to create it?
- Go to the folder where you want to create an env and write
python3 -m venv env
it will create an folder naming env in the directory
- Now go to the env folder by typing
cd env
then locate the activate.bat in the Scripts forlder Typecd Scripts
then typeactivate
Now you will notice the changed terminal with (env) written over it.
Voila!! You activated your virtual environment, now install your favourite libraries via pip.