🏋️♀️ When it comes to running JupyterLab & JupyterNotebooks, the install is pretty hefty, with quite a few dependencies.
🦉 To avoid the travails of picking through a messy base install of Python on your dev machine, it is wise to always use a virtual environment.
👍 Thus running JupyterLab in a virtual environment is a good idea.
Here's how using macOS.
- Navigate to a suitable directory in which want to work, or make a new one.
- Copy the Jupyter Notebook that you want to work on to this directory.
Create a virtual environment and give it a name, in the example below, I'm using 'jup1'.
python3 -m venv jup1
Activate the the virtual environment.
Now that the venv is active we can install JupyterLab.
pip install jupyterlab
- The shortcuts for Jupyter Notebooks really help to speed up working with them. It pays to invest some time in learning them. Or, if you can't be bothered with that, just remember that 'shift' + 'return' runs a cell.
- If you want to check your notebooks into version control, such as github, make sure you clear the outputs first. To do so right-click on the notebook, or Edit > Clear All Outputs. Then save and do your commits.