Why do you need to create a Virtual Environment?
Sometimes, we need to have some dependencies of your project to be
isolated
from dependencies present in the system site to avoid conflicts and
Virtual
Environment lets you do this.
Creating a virtual environment lets you have your own independent set
of
installed Python packages in your site directories which is apart from
system
site directories. Virtual Environment lets you create an isolated
environment
for your python projects.
Creating a Virtual Environment :
Step 1: Install Virtual Environment package:
pip install virtualenv
Step 2: Create a new directory to work with and head over there:
mkdir venv
cd venv
Step 3: Now, create a new Virtual Environment in this directory
virtualenv myvenv
This creates a new virtual environment with the name "myvenv".
For using this Environment's packages you need to activate it.
Step 4: Activate the environment
myvenv\Scripts\activate
Now you are in virtual environment and ready to go with it.
Step 5: Deactivate the virtual environment
deactivate
Helpful
ReplyDeleteThanks for your feedback
DeleteReally helpful
ReplyDeleteThanks for your feedback.
DeleteIs there any other method also?
ReplyDeleteNo, you always have to install virtualenv or venv module to create virtual environment in python. Thank you for your valuable question.
DeleteThanks for your feedback.
ReplyDeleteGreat Blog...Really it's so helpful...Keep It Up🙂
ReplyDeleteThank you for the feedback!
DeleteReally helpful
ReplyDeleteThank you for the feedback!
DeleteHey 100% working tip
ReplyDeleteThank you for the feedback!
DeleteUser friendly tutorial....no hurdle while following the above said steps
ReplyDeleteThank you for the feedback!
DeleteReally helpful
ReplyDeleteGreat ...keep it up ...
ReplyDeleteThank you for the feedback!
DeleteVery Helpful.
ReplyDeleteThank you for the feedback!
Delete