Python

Anaconda3 Python is available in /usr/local/anaconda3/bin.

Conda

You may install a conda environment in your home directory as described in the conda documentation: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html

Tip

I recommend disabling the automatic base activation. Run the following at the command line:

conda config --set auto_activate_base false

To list conda environments, run:

conda env list

To activate a conda base environment, run:

conda activate myenv

(replace <myenv> with your environment name)

packages

Conda provides excellent documentation for installing packages:

https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#using-pip-in-an-environment

To see a list of all packages installed in a specific environment, run:

conda list -n myenv

Install a package from the ‘defaults’ channel:

conda install -n myenv pip

Install a package from the ‘conda-forge’ channel:

conda install -n myenv pip --channel conda-forge

Note

Read more about conda-forge here: https://conda-forge.org/docs/user/introduction/

Conda integration with Grid Engine (batch processing)

By default, Grid Engine doesn’t initialize conda environments from a user’s .bashrc file.

To initialize conda, add the following line to your qsub submit script:

eval "$(/usr/local/anaconda3/bin/conda shell.bash hook)"
conda activate <environment>

(replace <environment> with your env name)

Jupyter Notebook

You may run jupyter notebook/lab anywhere on the neuro cluster, and view it on your local desktop.

  1. Log in via SSH, or X2Go remote desktop session

  2. If you logged in via X2Go, then open a terminal window

  3. From your terminal on the neuro cluster, 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:
    http://localhost:8780/?token=76e3a90efd4159sdfllfaa73e6f8sdf2b6dsdf3cddbc742f
    
  4. On your Mac, open a terminal window, and use the ssh command to create a tunnel:

    ssh -L <port>:localhost:<port> <username>@<servername>neuro.berkeley.edu
    
    where…
    the port number was automatically assigned in step #2, shown after the word ‘localhost:’. In this example, the port number is 8780.
    username is your neuro cluster user name
    servername is the neuro cluster server from in step #1 (where you ran the jupyter command).

    For example:

    ssh -L 8780:localhost:8780 user@nx1.neuro.berkeley.edu
    
  5. Copy and paste the URL displayed above (in step #2) into your web browser’s address bar on your desktop.