This tutorial shows non-admin users how to create their own custom Jupyter kernels with specific Python packages. No admin access required!
Use this method when you have a requirements.txt
file with the packages you need.
python3 -m venv ~/my-custom-env
Replace my-custom-env
with whatever name you prefer.
source ~/my-custom-env/bin/activate
pip install ipykernel
pip install -r requirements.txt
Or install packages individually:
pip install pandas numpy matplotlib scikit-learn
python -m ipykernel install --user --name=my-custom-env --display-name="My Custom Environment"
The --display-name
is what you'll see in Jupyter's kernel menu.
deactivate
If you already have a virtual environment set up, you can register it as a kernel.
source /path/to/your/venv/bin/activate
pip install ipykernel
python -m ipykernel install --user --name=my-project --display-name="My Project"
deactivate
jupyter kernelspec list
jupyter kernelspec remove my-custom-env
Your kernels are stored in: ~/.local/share/jupyter/kernels/
--user
flag installs the kernel only for your account (no admin needed)pip install --upgrade
Here's a complete example for a data science environment:
# Create and activate environment
python3 -m venv ~/ds-env
source ~/ds-env/bin/activate
# Install packages
pip install ipykernel
pip install pandas numpy scipy matplotlib seaborn scikit-learn jupyter
# Register kernel
python -m ipykernel install --user --name=ds-env --display-name="Data Science"
# Deactivate
deactivate
jupyter kernelspec list
--user
flagipykernel
was installed in the virtual environment