Start prototyping immediately. When I first started using Python, the concept of a virtual environment was extremely elusive to me.
When I first started using Python, the concept of a virtual environment was extremely elusive to me. It often took me hours of searching and experimenting with creating one only to end up more confused than when I had started.
This article aims to be a one-stop-shop for understanding what virtual environments exactly do, how to create them, and linking them to your Jupyter Notebook.
Let’s first start with the story of Bob.
Bob works at a large financial firm as a Data Scientist. Bob and his team all use Python and regularly collaborate with each other on certain projects. However, since this financial firm is quite large, they all have numerous individual projects they are working on as well. Because of this, there needs to be a universal way to separate these projects from each other to ensure they run on any computer with Python installed. This is where virtual environments come into play.
You can think of a virtual environment as a specific copy of Pythonin your computer that you can specify yourself. This copy can be any version of Python with any packages installed. Using virtual environments ensures that there are certain barriers between projects. These barriers in place make sure that anyone can run your version of Python regardless of what is on their computer.
I will be using Anaconda in this tutorial as it makes creating and maintaining virtual environments extremely easy. If you do not have it downloaded, you can set up the individual edition on Anaconda’s website. It may take some time to download fully.
If you allow Anaconda to set up a PATH variable, then you can follow what I do on your command prompt. If you do not, you can still follow these steps on your Anaconda Prompt that comes with the download.
Let’s first start by creating a new environment. I will be naming it
tutorial, but you can call it whatever you like:
$ conda create -n tutorial python=3.7
-nindicates the name of the virtual environment
python=3.7is optional and can be changed to any version. I prefer setting a specific version when creating the environment as it will give you a “bare bones” Python environment to work within.
yand hit Enter.
🔵 Intellipaat Data Science with Python course: https://intellipaat.com/python-for-data-science-training/In this Data Science With Python Training video, you...
🔥Intellipaat Python for Data Science Course: https://intellipaat.com/python-for-data-science-training/In this python for data science video you will learn e...
Master Applied Data Science with Python and get noticed by the top Hiring Companies with IgmGuru's Data Science with Python Certification Program. Enroll Now
Python Programming Tutorials For Beginners
Become a data analysis expert using the R programming language in this [data science](https://360digitmg.com/usa/data-science-using-python-and-r-programming-in-dallas "data science") certification training in Dallas, TX. You will master data...