Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Suppose you want to save your notebook in a location other than your home directory (e.g. on /code). This can be done by making a soft link from your top1/gpu1 home directory. In a terminal, type the following
    $ ln -s /code/username/ ~/code
  2. Suppose you want to use your own anaconda environment to run the notebook. The instructions to do so come from here. Again, in the terminal,
    $ conda create --name myenv python=3.7
    $ source activate myenv
    $ conda install jupyter
    $ python -m ipykernel install --user --name python_custom --display-name "My Python"
    You'll then be able to choose your environment from the new notebook tab, or change the kernel from within a notebook.
  3. There are a lot of keyboard shortcuts in jupyter. To enter command mode, press esc. Then type the jupyter command.
  4. Cells do support markdown formatting, so you can insert LaTeX equations into your notebooks.
  5. Version control can be used with jupyter notebooks. I store all of my notebooks in a git-watched directory. However, I usually clear all cell outputs before committing to git, to avoid committing lots of garbage image data in the .ipynb files and cluttering up the git record.
  6. Do you want a package that isn't installed? Is one of your packages out of date? If it's a typical package, you can ask Peter to install it on the default kernel. Otherwise, setup your own anaconda environment and install it yourself. Follow the instructions in tip #2.
  7. Keep in mind that kernel instances are opened in the default environment where the JupyterHub server was started, i.e. whatever environment Peter happened using when he started the server. So you will not be able to access the environment variables of your custom anaconda environment with os.environ['PATH'] or os.getenv('PATH'), as you would be able to do if you were running a jupyter notebook on your own server. Anyway, this can be fixed by printing out the environment variable you want in a terminal window with the appropriate environment activated, and pasting it into python.
    $ source activate myenv

    $ echo $PATH
    Then, in your jupyter notebook,
    In [1]: os.environ['PATH'] = ...

...