import sys
sys.executable'/home/isaias/analisis_datos/python_book/.venv/bin/python3'
Inside your Python environment, install Jupyter Notebook:
python -m pip install notebookCheck that it was installed:
jupyter notebook --versionipykernelipykernel allows a Python environment to be used as a kernel in Jupyter.
Install it with:
python -m pip install ipykernelRun:
python -m ipykernel install --user --name my-environment --display-name "Python (my-environment)"For example:
python -m ipykernel install --user --name data-analysis --display-name "Python (Data Analysis)"The two names have different purposes:
--name: internal Jupyter kernel name.--display-name: name shown in the Jupyter interface.jupyter kernelspec listExample:
Available kernels:
python3 /home/user/.local/share/jupyter/kernels/python3
data-analysis /home/user/.local/share/jupyter/kernels/data-analysis
Inside a notebook cell:
import sys
sys.executable'/home/isaias/analisis_datos/python_book/.venv/bin/python3'
Example output:
/home/user/project/.venv/bin/python
This is useful for checking that Jupyter is using the expected Python environment.
You can also inspect the Python version:
import sys
print(sys.version)
print(sys.executable)3.12.3 (main, Jun 19 2026, 12:46:00) [GCC 13.3.0]
/home/isaias/analisis_datos/python_book/.venv/bin/python3
First list the kernels:
jupyter kernelspec listThen remove one:
jupyter kernelspec uninstall data-analysisJupyter will ask for confirmation.
For an existing Python environment, the complete Jupyter setup is usually:
python -m pip install notebook ipykernelRegister the environment:
python -m ipykernel install --user \
--name data-analysis \
--display-name "Python (Data Analysis)"Check it:
jupyter kernelspec listLaunch Jupyter:
jupyter notebookThen select:
Python (Data Analysis)
as the notebook kernel.