.. _python: ====== Python ====== :Last modified: |today| .. _python_availability: Anaconda Python is available in /usr/local. modules ======= I recommend using pip to install additional python modules in your home directory. In the examples below, replace with your module name: pip:: pip install --user The package will be installed in $HOME/.local. setup.py:: python setup.py install --prefix=$HOME/.local .. _jupyter: Jupyter Notebook ================ .. _jupyterperf: performance ----------- You can improve performance of jupyter notebook by accessing it directly from your Mac's web browser (e.g. safari). Below are instructions: #. Start a :ref:`X2Go remote desktop session`. Note the server name that you logged into. #. 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: | http://localhost:8780/?token=76e3a90efd4159sdfllfaa73e6f8sdf2b6dsdf3cddbc742f | | The number after the string 'localhost:' is called the port number. You will need this port number in the next step. #. 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 :localhost: @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 :ref:`SSH key`). #. Copy and paste the URL displayed above (in step #2) into the web browser on your Mac.