Installation

Interested in trying out AISpace2? Get started here.

Start Here!

We’re happy to have you here. Follow the steps below and you’ll learn how to get setup with Jupyter and the AISpace2 extension. We highly recommend using a modern and up-to-date browser for the best experience, such as the latest versions of Edge, Firefox, Chrome or Safari.

JupyterHub

Using JupyterHub means you won’t have to install anything on your computer — everything takes place online.

  1. Go to ubc.syzygy.ca if you are a UBC student, and sign in with your CWL. Otherwise, go to wherever your JupyterHub instance is located and sign in.
  2. Click Start My Server when prompted.
  3. Launch a terminal instance. You can do this in the notebook dashboard by selecting New > Terminal.
    New > Terminal
  4. Move on to the Get the Notebooks section.

Windows

If you are unfamiliar with the Python ecosystem and want the simplest installation, use Anaconda , a Python distribution with a lot of scientific computing tools already pre-installed. If you already have Python installed, or would prefer to install everything yourself, go here .

Using Anaconda

  1. Download Anaconda for Windows, making sure you select the Python 3+ version.
  2. Run the downloaded installer. The default options are fine.
  3. Open the Start menu and search for "Anaconda Prompt". Open it.
  4. Inside the prompt, run
    conda install -c conda-forge jupyterlab
    conda install -c conda-forge ipywidgets
    Enter ‘y’ when prompted to confirm the installation.
  5. Inside the prompt, run the following commands:
    pip install aispace2 --user
  6. Move on to the Running JupyterLab section or the Running JupyterNotebook section. We recommend using JupyterLab.

From Scratch

Installing Python

  1. Download the latest version of Python 3. It should be version 3.3 or later.
  2. Install it, and make sure you select Add Python to Path. This is very important! Installing Python on Windows

Installing AISpace2

  1. Once Python is installed, you should make sure your version of pip is up-to-date:
    python -m pip install --upgrade pip
  2. Then install Jupyter and AISpace2: Open the Command Prompt (Win + R, cmd.exe) and run:
    pip3 install jupyter
    pip3 install jupyterlab
    pip3 install aispace2 --user
  3. Move on to the Running JupyterLab section or the Running JupyterNotebook section. We recommend using JupyterLab.

macOS

If you are unfamiliar with the Python ecosystem and want the simplest installation, use Anaconda , a Python distribution with a lot of scientific computing tools already pre-installed. Otherwise, if you prefer installing all the dependencies yourself, go here .

With Anaconda

  1. Download Anaconda, making sure to get the Python 3+ version. The Python 2 version is not supported.
  2. Open a terminal, then execute:
    conda install -c conda-forge jupyterlab
    conda install -c conda-forge ipywidgets # Enter 'y' when prompted to install
    pip install aispace2 --user
  3. Move on to the Running JupyterLab section or the Running JupyterNotebook section. We recommend using JupyterLab.

Without Anaconda

  1. By default, macOS contains Python 2.7 (at least on Sierra, 10.12). You will need Python 3.3+ for it to work. Try running python3 --version in the terminal to see if you’ve already installed it. If it returns 3.3+, skip to the next step. If not, or it errors out, you will need to install Python 3:

    • If you have homebrew:
      • Run brew install python3 or, if you already have Python 3 installed but need the latest version, brew upgrade python3
    • Otherwise:
  2. Then, confirm that pip (the Python package manager) is also installed (which it should be, as it is usually installed alongisde Python). Run pip3 --version and it should output something like:

    pip 9.0.1 from /usr/local/lib/python3.6/site-packages (python 3.6)

    You also want to make sure pip is updated: run pip3 install --upgrade pip. Your pip3 --version should be >9.0.0. If you encounter any problems with pip, refer to the guide here for further instructions.

  3. All that is left to do is to install Jupyter and enable our extension:
    pip3 install jupyter
    pip3 install jupyterlab
    pip3 install aispace2 --user
  4. Move on to the Running JupyterLab section or the Running JupyterNotebook section. We recommend using JupyterLab.

Linux

  1. You will need to install Python 3.3+.
  2. After that, you can install Jupyter and the AISpace2 extension by running the following:
    pip3 install jupyter
    pip3 install jupyterlab
    pip3 install aispace2 --user
  3. Move on to the Running JupyterLab section or the Running JupyterNotebook section. We recommend using JupyterLab.

Running JupyterLab

  1. You will need to install nodejs and npm if you do not have them already installed. You can find installation instructions here.
  2. After that, you can install the lab extension by running the following:
    jupyter labextension install aispace2
    jupyter labextension install @jupyter-widgets/jupyterlab-manager
  3. You should now move on to the Get the notebooks section.

Troubleshooting aispace2 labextension installation

If you are using node 10 and your installation of the aispace2 labextension hangs, try to install it using node 8.

You can do this by installing nvm and running

nvm install 8
nvm use 8
in the same terminal as where you will be installing the extension.

Running JupyterNotebook

  1. Run the following:
    jupyter nbextension install aispace2 --user --py
    jupyter nbextension enable widgetsnbextension --py
    jupyter nbextension enable aispace2 --user --py

    If everything is successful, you should see the following output:

    Enabling notebook extension aispace2/extension...
        - Validating: OK
  2. You should now move on to the Get the notebooks section.

Get the notebooks

In the folder where you would like to save the notebooks, run

git clone https://github.com/AISpace2/AIPython.git
cd AIPython
jupyter lab
This will launch Jupyter Lab in your default browser. We recommend that you view the widgets using Chrome. After you run jupyter lab, the url at which the jupyter notebooks are running will be printed out in the terminal. You can copy paste this url into Chrome.

Upgrading

Already have AISpace2? No matter which operating system you use, or what method you used to install it, updating AISpace2 is as simple as running one line in the command prompt or terminal:

pip3 install aispace2 --user --upgrade
jupyter labextension update aispace2

Make sure to restart Jupyter after doing this for the changes to take effect.

If the command to update the jupyter lab extension did not work, you can try uninstalling and reinstalling the extension:

jupyter labextension uninstall aispace2
jupyter labextension install aispace2