A simple guide for creating Virtual Environment in Jupyter Notebook(Python) for Windows.
Utkarsh AnkitBlockedUnblockFollowFollowingMar 4Sometimes there are situations where we need to develop our code in some different conditions according to some certain requirements.
Like for example we are working on Python3 but in some cases we need to use Python2.
Or we need to use some library that only support certain python version.
We can also make our customized environment for particular needs and put all the required libraries installed in that environment only.
Sometimes this turns out to be very helpful.
But creating it on jupyter notebook is not that smooth process which can work without error.
This guide will help you to create your virtual enviornment in a simple way:-(I am assuming that you have already using Anaconda based Jupyter Notebook environment, if not download it from here)Now for creating virtual environment :-Make sure you have having good internet connectivity.
Open Anaconda Prompt (let’s assume we are making a virtual environment for python 3.
0, naming it as ‘NewEnv’) and write-conda create–name NewEnv python=3.
0let it download for sometime.
After that write :-conda activate NewEnvNow your new environment is successfully created and activated, it’s name is ‘NewEnv’.
Now after activating it, write:-pip install ipykernel5.
Let it download and install for some time.
Then after that write:-python -m ipykernel install –user –name=NewEnvNow the new environment has been installed in Jupyter notebook.
Install all the required libraries in your new environment.
To deactivate or get back to base environment, just write :-conda deactivate8.
Now check that your new virtual environment is installed in Jupyter Notebook or not.
If it is showing in the New option then it is successfully installed in your Jupyter Notebook.
If it is not showing then check all the steps and try again.
If you want to install any library in that environment, then just go to anaconda prompt, activate your environment (shown in step-3), then install your required library using ‘pip’ or ‘conda’.
Then it will work fine.