Skip to content

Install and Setup Jupyter Notebook Lab for Testing

Don Jayamanne edited this page Aug 28, 2023 · 2 revisions

Pre-requisites

  1. Create a new folder
  2. Open folder in VS Code, with Python extension installed
  3. Run Python: Create Environment..., choose venv and your default Python installation
  4. Open a new Terminal
  5. Run python -m pip install jupyter
  • python -m pip install jupyterlab jupyter notebook

CLI to start Jupyter Notebook/Lab

  1. Start Jupyter Notebook
    python -m jupyter notebook --NotebookApp.allow_origin='*'
  2. Start Jupyter Lab
    python -m jupyter lab --NotebookApp.allow_origin='*'
  3. Start Jupyter Lab with a specific token
    python -m jupyter lab --NotebookApp.allow_origin='*' --NotebookApp.token=ABCD
  4. Start Jupyter Lab with an empty token
    python -m jupyter lab --NotebookApp.allow_origin='*' --NotebookApp.token=
  5. Start Jupyter Lab with an empty password and empty token
    python -m jupyter lab --NotebookApp.allow_origin='*' --NotebookApp.token= --NotebookApp.password=
  6. Start Jupyter Lab with a specific Password = 'Hello'
    First generate the hash of the password Hello
    python -c "from notebook.auth import passwd;print(passwd('Hello', 'sha1'))"
    sha1:f38e2e15d770:b97ffda8260e04ab8123b67eea9989764bf9690b
    Use the output from the previous step to pass the hashed password as follows:
    python -m jupyter lab --NotebookApp.allow_origin='*' --NotebookApp.password=sha1:f38e2e15d770:b97ffda8260e04ab8123b67eea9989764bf9690b
Clone this wiki locally