Enabling virtualenv on jupyter notebook

vivekatwal

vivek atwal

Posted on June 30, 2022

Enabling virtualenv on jupyter notebook

Introduction

Jupyter notebook make life easier for

  • Begineer to learn and understand step by step
  • Experts to explore data,visualiations.
  • Mentors to create course
  • Speakers for demonstration

While exploring same libraries have different versions and you need to test those version separately. They can be installed on separate virtualenvs.

Now in order to make this environment quickly accessible, we need to add this env to jupyter notebook as kernels.

Below are the steps:

Jupyter

Installation

sudo apt install jupyter-core
Enter fullscreen mode Exit fullscreen mode

Activate the env and the install ipykernel

pip install ipykernel
Enter fullscreen mode Exit fullscreen mode

Inorder to differentiate different environemnt, you have to name them, Name them with along with packgae version

ipython kernel install --user --name=envname_pkg_v1
Enter fullscreen mode Exit fullscreen mode

To view all the environment

jupyter kernelspec list
Enter fullscreen mode Exit fullscreen mode

Remove environment from jupyter

jupyter kernelspec uninstall envname
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
vivekatwal
vivek atwal

Posted on June 30, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related