Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To use a virtual or conda environment in Jupyter Notebook, install ipykernel with that environment’s Python, then register it as a kernel. Installing Jupyter and registering an environment are separate steps: an environment can exist on your computer without appearing in Notebook’s kernel list.

What Jupyter Notebook does—and what a kernel does

The classic Jupyter Notebook interface is a web application for documents that combine live code with narrative text, equations, and visualizations. Jupyter also provides other interfaces, including JupyterLab. The interface is the place where you create and view notebooks; a kernel is the language-specific process that executes their code. For Python notebooks, that process is typically powered by ipykernel. Project Jupyter’s overview of installing and using Jupyter describes the Notebook interface, while its kernels overview explains the role of kernels.

This distinction explains the common missing-environment problem: installing Notebook does not automatically make every Python environment on the machine a selectable kernel.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose how to install Jupyter

The classic Notebook installation guide describes Anaconda as a convenient route for new users and pip as an alternative for people already managing Python packages. Which is appropriate depends on your existing setup and which Python installation you want to maintain. Python is required for the classic Notebook interface, and its version requirements depend on the Notebook release, so check the current classic Notebook installation guide for the release you plan to install.

Route When it fits Important distinction
Anaconda or another conda workflow You want a distribution and environment-management workflow suited to your needs. Conda setups are not all identical; follow the guidance for the distribution you chose.
pip You already manage Python packages and want to install the classic interface with pip. Run pip through the intended Python interpreter so packages go to the expected installation.

For a pip-managed Python installation, install the classic interface with:

python -m pip install notebook

Then launch it with:

jupyter notebook

These commands use whichever python and jupyter resolve in your shell. If you use a virtual environment, activate it first when that is where you want Jupyter installed. If your workflow uses conda, consult the current installation instructions for your chosen distribution rather than assuming every conda installation uses the same steps.

Create or activate the environment for your notebook code

Decide which Python installation should run the notebook’s code and hold its dependencies. Create or activate that virtual environment or conda environment before installing or registering its kernel. The key is to use that environment’s Python executable—not an unrelated system Python or a pip command that may point elsewhere.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • In a virtual environment, activate it using the method appropriate to your operating system and shell.
  • In a conda workflow, activate the environment you want Notebook to use.
  • If you have multiple Python versions, confirm that the command named python in the active environment is the interpreter you intend to expose.

For details on installing the IPython kernel in an environment, see the IPython kernel installation guide.

Install and register the environment as a Python kernel

With the intended environment active, install ipykernel and register it:

python -m pip install ipykernel
python -m ipykernel install --user --name myenv --display-name "Python (myenv)"

Replace myenv with a unique, machine-readable name for this kernelspec. The internal --name identifies it; --display-name sets the friendly label shown in the Notebook interface. Reusing an internal name overwrites the existing kernelspec with that name, so choose a distinct name if you need to keep multiple environments registered.

The registration command writes a kernelspec that tells Jupyter how to start the kernel. It does not move packages between environments. The Python executable used to register it should therefore be the one belonging to the environment whose code and dependencies you want to run.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When Jupyter and the kernel are in different environments

If Jupyter runs from one environment but the kernel’s Python belongs to another, IPython documents using --prefix to install the kernelspec where that Jupyter environment can discover it:

/path/to/kernel/env/bin/python -m ipykernel install 
  --prefix=/path/to/jupyter/env --name python-my-env

The first path is the Python executable that will run notebook code. The prefix is the Jupyter environment where the kernelspec should be made available. The example uses Unix-style paths; on Windows, use the corresponding Python executable paths for both environments. Keep the internal name unique; add --display-name "Python (my-env)" if you want a particular friendly label in the menu.

Select the kernel in Notebook

Open a notebook and choose the registered display name from the kernel menu. The selected kernel determines which Python interpreter runs the notebook’s cells; the Notebook interface itself is just the frontend. When the kernel starts, a cell that checks the active interpreter can help confirm which Python is in use:

import sys
print(sys.executable)

The printed path should point to the environment you intended to select.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why your environment is missing from the kernel list

Work through these checks in order. They distinguish a missing registration from a kernelspec that the running Jupyter server cannot find.

  1. Install ipykernel in the intended environment. Activate that environment and run python -m pip install ipykernel. Using python -m pip ties the installation to the active interpreter instead of relying on whichever standalone pip appears first on the shell path.
  2. Register the environment from that Python. Run python -m ipykernel install --user --name myenv --display-name "Python (myenv)" while the environment is active. Give each kernelspec a unique internal name.
  3. Check what the Jupyter installation sees. Run jupyter kernelspec list using the Jupyter installation that launches Notebook. If the new name is absent, the issue is likely registration or discovery rather than the notebook’s menu.
  4. Inspect Jupyter’s data paths. Run jupyter --paths and jupyter --data-dir in the same context as the server. Kernelspec discovery uses Jupyter data locations, which vary by operating system and can be changed with settings such as JUPYTER_PATH and JUPYTER_DATA_DIR. See Jupyter’s directories and file locations documentation.
  5. Match the registration location to the running server. A kernelspec registered for a different user, Python installation, or Jupyter data prefix may not be visible to the server you started. If Jupyter and the kernel live in separate environments, use the documented --prefix approach to install the spec into the Jupyter environment’s search locations.
  6. Separate visibility problems from import errors. If the kernel appears and starts but an import fails, the environment may not contain the dependency that notebook code expects. Install that package into the selected environment’s Python, not merely into the environment that runs the Jupyter interface.

Jupyter’s kernel installation documentation covers adding kernels for languages and environments. Python uses ipykernel; notebooks in other languages need the appropriate language-specific kernel.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How to add a virtual environment or conda environment

The procedure is the same in principle for either manager: activate the environment, install ipykernel with its Python, and register that interpreter. In a conda workflow, the official IPython instructions also demonstrate creating an environment that includes ipykernel, activating it, and then registering it. Follow the exact environment-creation syntax for your conda distribution and operating system; the important check is that the registration command runs with the target environment’s Python.

Once registered, a virtual or conda environment is available as a kernel only to Jupyter installations that can discover its kernelspec. If it does not appear, use the discovery checks above rather than reinstalling the Notebook interface without first checking which Python and Jupyter paths are involved.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.