| date_revised | 2022/06/15 |
|---|---|
| revised_by | wfordwfu |
A Jupyter devcontainer datascience solution based on the Jupyter/Docker-Stacks solution.
- Make sure server is running
jupyter server list - From shell run
./jupyter.shor go to http://localhost:8888/lab
- Docker Desktop - Ideally install from Software Center
- VS Code
- VS Code Remote Containers Extension
These are useful if you JupyterLab instance has locked up
docker pslist running containersdocker kill $(docker ps -q)stop any running containersdocker rm $(docker ps -aq)remove any stopped containersdocker logs wfbmi-devIf you need to get the url\token to log back into your instance
Start here: How to use Jupyter Lab (YouTube)
Think of a jupyter notebook interface like VIM lite. You can use your mouse, but you can navigate jupyter via keyboard much faster.
- To enter a cell: enter
- To run a cell: ctrl-enter
- To run a cell and create a new one: shift-enter
- To exit a cell back to command mode: escape
When in command mode you have commands like this:
- Basic navigation: enter, shift-enter, up/k, down/j
- Saving the notebook: s
- Change Cell types: y, m, 1-6, t
- Cell creation: a, b
- Cell editing: x, c, v, d, z
- Kernel operations: i, 0 (press twice)
- If you need a package and it's not installed, you can run
pip install xdirectly within a code cell. Jupyter will know what to do. - If you need help with a function you can type it into a cell followed by ? and run
print? - While writing code, hitting Tab will display hints
Lots to learn here, but this is a good starting list
%lsmagiclist of magic commands.%run <file name>.pyto run an external python file within your jupyter notebook.%%timeat the top of a code block will return the execution time%wholist all the current variables in a notebook%pinfo <variable>query specifics about a given variable in a notebook%envlist all the environment variables%env FOO=Barset the value of a new environment variable
There's lots more to explore about Jupyter:
- Check out the help menu in JupyterLab
- Jupyter lab docs
- Jupyter Docker Stacks
- jupyter notebook docs
- jupyter docker stacks
- Example Notebooks
- nbconvert changed a value in version 6.0 and many jupyter related packages haven't updated
- Example error "Config option
template_pathnot recognized by*. Did you mean one of:extra_template_paths, template_name, template_paths?"
- Example error "Config option
- xeus-sqlite
conda install xeus-sqlite jupyterlab -c conda-forge