Using Python digital environments with Jupyter notebooks
If you’re utilizing Jupyter notebooks (aka IPython notebooks), and you have already got Jupyter put in systemwide, create your digital atmosphere and activate it. Then, out of your digital atmosphere listing, run pip set up ipykernel so as to add the wanted elements for IPython. Finally, run ipython kernel set up —consumer —title=<project_name>, the place project_name is a reputation you wish to affiliate with that individual venture. From there you must be capable to launch Jupyter and swap to the IPython kernel you put in contained in the digital atmosphere.
Upgrading Python digital environments
When you improve a Python runtime in your system, digital environments that use that model of Python aren’t robotically upgraded. That’s your accountability. And that’s by design, as a result of unwitting upgrades to Python variations can break their attendant packages.
If you’ve upgraded an present Python interpreter with a minor level improve—e.g., from Python 3.13.1 to Python 3.13.3—you possibly can improve any corresponding digital environments simply sufficient. From a command immediate within the venture listing, enter:
python -m venv /path/to/venv --upgrade
Don’t activate the digital atmosphere beforehand, or the improve could not work.
Alternatively, as famous above (see “Removing the Python virtual environment”), you could possibly elect to take away the venv fully and recreate it utilizing your necessities.txt or pyproject.toml file.
If you’ve put in a main new model of Python—e.g., you have already got Python 3.10 and also you now set up Python 3.11 alongside it—you’ll must create a brand new digital atmosphere that particularly makes use of the brand new main level model. Do not try to improve an present digital atmosphere to a better main level model of Python.






