Link Your Virtual Environment to Jupyter with Kernels

Link Your Virtual Environment to Jupyter with Kernels

Start prototyping immediately. When I first started using Python, the concept of a virtual environment was extremely elusive to me.

Introduction:

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.


What is a Virtual Environment?

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.


Create an Environment using Anaconda

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

Notes:

  • -n indicates the name of the virtual environment
  • python=3.7 is 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.
  • You will be asked to proceed with a set of packages to be installed. Type in y and hit Enter.

programming data-science python tutorial virtual-environment

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Data Science With Python Training | Python Data Science Course | Intellipaat

🔵 Intellipaat Data Science with Python course: https://intellipaat.com/python-for-data-science-training/In this Data Science With Python Training video, you...

Python for Data Science | Data Science With Python | Python Data Science Tutorial

🔥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...

Applied Data Science with Python Certification Training Course -IgmGuru

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

Python Programming Tutorials For Beginners

Data Science Course in Dallas

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...