Thursday, December 02, 2021

MacOS: install Jupyter-Lab (next gen notebook) in virtual environment

The classic Jupyter notebook, according to jupyter.org, opens each file on separate web browser tab, while the new Jupyter-lab runs like an IDE on one web browser tab.


OSX default to python 2, so I use virtual environment for python3.


(activate venv, see bottom)


# Installation,  reference:     jupyter.org

python3 -m pip install -U pip

python3 -m pip install jupyterlab


# launch server

$ jupyter-lab


# if web browser doesn't start up automatically, manually copy-and-paste the http link from the html to your web browser

...


This page should redirect you to a Jupyter application. If it doesn't,

    <a href="http://localhost:8888/lab?token=..."   



searched   jupyter keyboard shortcuts     , found some good ones in github.

NOTE that on OSX, use 'command' instead of 'ctrl' key



* * * * * *

if first time using virtual environment, create one is simple:


# create a new virtual environment

$   python3 -m venv ~/.venv/py3            


# enter the new environment

$   source  ~/.venv/py3/bin/activate


# play inside the environment, for example:

(py3)  $  python --version


# exit the environment

(py3)  $  deactivate



Labels: , , , ,