Here, in this article, we will create one virtual env and install jupter notebook in it.
Let's begin with installing pythong virtual env package:
# Replace "lab-env" with the name you want for your environment
virtualenv lab-envStep 4: Activate the Virtual Environment
- On Windows, activate the environment with:
myenv\Scripts\activateOn MacOS and Linux, activate the environment with:
source myenv/bin/activateStep 5: Install Jupyter
While in your virtual environment, install Jupyter:
pip install jupyterStep 6: Install Kernel (within the virtual environment)
You will need to install the IPython kernel in your virtual environment to use it with Jupyter.
pip install ipython
pip install ipykernelReplace lab-env with the name you want for your Jupyter kernel.
Step 7: Start Jupyter Notebook
While still in your virtual environment, start Jupyter Notebook:
jupyter notebookStep 8: Select the Virtual Environment Kernel in Jupyter
- Open a browser window with the Jupyter interface.
- Navigate to the notebook or create a new one.
- Click on the “Kernel” menu.
- Choose “Change Kernel” and select the virtual environment kernel you created (in this case, it will be named “myenv”).
Now, your Jupyter notebook will be using the Python environment from your virtual environment.
Step 9: Deactivate the Virtual Environment
When you’re finished working in your virtual environment, you can deactivate it by running:
deactivateRemember, you’ll need to activate the environment again before using it in the future.