Python

Last modified:December 07, 2019

Anaconda Python (version 2 and 3) is available in /usr/local.

modules

To check if Anaconda provides a module, run the command (replace <module> with your module name):

conda search <module>

If it’s available, email support@cirl.berkeley.edu to request installation.

If the module isn’t available via Anaconda, or you want to install the module yourself, then use pip or setup.py (replace <module> with your module name):

pip:

pip install --user <module>

The package will be installed in $HOME/.local.

setup.py:

python setup.py install --prefix=$HOME/.local

Jupyter Notebook

performance

You can improve performance of jupyter notebook by accessing it directly from your Mac’s web browser (e.g. safari). Below are instructions:

  1. Start a X2Go remote desktop session. Note the server name that you logged into.

  2. In your X2Go session, open a terminal window, and run ‘jupyter notebook’ with the ‘–no-browser’ option:

    jupyter notebook --no-browser
    You will see output similar to the following:
    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
    The number after the string ‘localhost:’ is called the port number. You will need this port number in the next step.
  3. On your Mac, open a terminal window, and run the ‘ssh’ command to create a tunnel from your Mac to your X2Go session. The syntax is:

    ssh -L <port>:localhost:<port> <username>@<servername>neuro.berkeley.edu

    For example, user ‘joe’ logged into nx66.neuro.berkeley.edu via X2Go. His jupyter notebook started on port number 8780, so he ran the following in his Mac terminal:

    ssh -L 8780:localhost:8780 joe@nx66.neuro.berkeley.edu

    The ssh command will prompt you for a password and for your 2-step verification code or ssh key passphase (if you configured a SSH key).

  4. Copy and paste the URL displayed above (in step #2) into the web browser on your Mac.