[Python] python jupyter - why ipykernel needed when installed in virtualenv

Discussão em 'Python' iniciado por Stack, Maio 9, 2025.

  1. Stack

    Stack Membro Participativo

    Using virtual environment python3 -m venv myenv, and activating it by source myenv/bin/activate, then installing jupyter (as a regular package) using package manager pip python -m pip install jupyter.

    Python binary and module/package pip & jupyter are from the virtual environment:

    • Python is from the myenv: which python returns myenv/bin/python.
    • And the package jupyter provides a binary: which jupyter returns myenv/bin/jupyter.
    • And jupyter is installed as a package in the virtual environment: The output of python -c 'print(__import__("jupyter").__file__)' is .../myenv/lib/python3.8/site-packages/jupyter.py

    Then:


    • Which python binaries (kernels) does jupyter then see and why? (web interface: kernel → change kernel, or jupyter kernelspec list)


    • Do we need to register the virtual environment's python binary? python -m ipykernel install --user --name=myenv

    related How do I add python3 kernel to jupyter (IPython)

    Continue reading...

Compartilhe esta Página