Outils pour utilisateurs

Outils du site


tech:utiliser_virtualenv_dans_un_notebook_ipython

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

tech:utiliser_virtualenv_dans_un_notebook_ipython [2025/03/24 15:06] – créée - modification externe 127.0.0.1tech:utiliser_virtualenv_dans_un_notebook_ipython [2026/05/30 22:00] (Version actuelle) Jean-Baptiste
Ligne 1: Ligne 1:
 +<!DOCTYPE markdown>
 +{{tag>Brouillon Python}}
 +
 +# Utiliser virtualenv dans un notebook iPython
 +
 +Source : https://help.pythonanywhere.com/pages/IPythonNotebookVirtualenvs/
 +
 +Install the ipython kernel module into your virtualenv
 +~~~bash
 +python3 -m venv plop
 +cd plop
 +source bin/activate
 +pip install --upgrade pip
 +pip install ipykernel
 +#deactivate
 +~~~
 +
 +Now run the kernel "self-install" script
 +~~~bash
 +python -m ipykernel install --user --name=plop
 +~~~
 +
 +
 +Replacing the `--name` parameter as appropriate.
 +
 +You should now be able to see your kernel in the IPython notebook menu: `Kernel -> Change kernel` and be able so switch to it (you may need to refresh the page before it appears in the list). IPython will remember which kernel to use for that notebook from then on.
 +
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki