how to create a virtual environment for python project

Do you want to know the information regarding “how to create a virtual environment for python project”. If yes, you’re in the correct post.

how to create a virtual environment for python project

pip install virtualenv
cd projectfolder #go to project folder
virtualenv projectname #create the folder projectname 
source projectname/bin/activate
# First install virtualenv
!pip3 install virtualenv

# Go to the desired directory which you wish you run your virtual environment.
cd project_directory

# create a virtual environment called my_virtualenv
virtualenv my_virtualenv

### to run the virtual environemt run "activate" as in the following command
.\my_virtualenv\Scripts\activate

Final Words

I hope this post helps you to know about “how to create a virtual environment for python project”. If you have any questions regarding this article please let us know via the comment section. Share this post with your friends & family via social networks.

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coder Diksha. Here, I post about programming to help developers.

Share on:

Leave a Comment