Skip to content

Latest commit

 

History

History
53 lines (38 loc) · 1.75 KB

File metadata and controls

53 lines (38 loc) · 1.75 KB

Note: these instructions will only work if you're on our most recent system image

You can use a virtualenv for your IPython notebook. Follow these steps:

  1. For the version of Python that you want in your virtualenv, get the version of the jupyter package

    so for example, if you want to use Python 3.10, run the following and note the version:

     :::bash
     pip3.10 show jupyter
    

    If there is no version, you can probably just use 1.0.0 at the moment

  2. Install the package with the appropriate version into your virtualenv:

     :::bash
     workon my-virtualenv-name  # activate your virtualenv, if you haven't already
     pip install jupyter==<jupyter version from above>
    
  3. If you're on the "haggis" or the "innit" system image, run the following:

     :::bash
     ipython kernel install --name "venv-name" --user
    

    The name that you give to the kernel can be anything as long as it only contains ASCII letters and numbers and these separators: - . _ (hyphen, period, and underscore)

  4. You should now be able to see your kernel in the IPython notebook menu: Kernel -> Change kernel and be able to 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.

**Note: ** For this to work, your virtualenv must be in the standard virtualenv directory. That is ~/.virtualenvs