Skip to content

Install and Setup Jupyter Notebook Lab for Testing

Don Jayamanne edited this page May 28, 2023 · 2 revisions
  • Install Python on your machine (preferably from https://www.python.org/downloads/) Note: Ananconda/Miniconda/PyEnv are other great (if not better) options.
  • Once installed open a terminal in a specific folder (thats where we will create the Python Virtual Environment)
  • In the terminal ensure the previously install Python executable is in your path
  • Create a Python environment, install the python packages as follows in the terminal
  • python -m venv .venv (if you run into errors, replace python with the fully qualified path to python exe from previous installation)
  • source .venv/bin/activate
  • python -m pip install jupyter lab notebook

If you now want to start Jupyter you can use python -m jupyter notebook

Options

  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