Skip to content

Install notebooks in existing openvino_env environment

Helena Kloosterman edited this page Dec 15, 2021 · 3 revisions

📚 OpenVINO Notebooks Installation in an Existing Virtual Environment

If you already installed openvino-dev in an openvino_env environment according to the openvino-dev installation instructions, follow these instructions to install the notebook requirements in the same environment.

If you have not installed openvino-dev yet, do not use this guide, but follow the main Notebooks Installation Guide to install both openvino-dev and the requirements for the notebooks.

📝 Installation Guide

NOTE: If OpenVINO is installed globally, please do not run any of these commands in a terminal where setupvars.bat or setupvars.sh are sourced. For Windows, we recommend using Command Prompt (cmd.exe), not PowerShell.

Step 1: Activate the Environment

NOTE: This step can be skipped if openvino_env is already activated: if you see (openvino_env) at the start of the command line.

NOTE: This step should be done in the directory that contains openvino_env.

For Linux and macOS:

source openvino_env/bin/activate

For Windows:

openvino_env\Scripts\activate

Step 2: Clone the Repository

Note: Using the --depth=1 option for git clone reduces download size.

git clone --depth=1 https://github.com/openvinotoolkit/openvino_notebooks.git

Step 3: Go to the Notebooks Directory

cd openvino_notebooks

Step 4: Install the Packages

Option A: Full installation for all notebooks

The requirements.txt file contains the requirements for all notebooks. This includes Jupyter Lab to run the notebooks, and PyTorch and TensorFlow to convert models to OpenVINO. Installing all the requirements may take some time.

pip install -r requirements.txt

Option B: Minimal installation

To run notebooks that demonstrate OpenVINO Inference Engine, you only need to install Jupyter Notebook. This enables running the Hello World and Monodepth notebook.

pip install notebook

Step 5: Install the virtualenv Kernel in Jupyter

python -m ipykernel install --user --name openvino_env

Step 6: Launch the Notebooks!

# To launch a single notebook, for example monodepth:
jupyter notebook notebooks/201-vision-monodepth/201-vision-monodepth.ipynb

# To launch all notebooks in Jupyter Lab
jupyter lab notebooks

In Jupyter Lab, select a notebook from the file browser using the left sidebar. Each notebook is located in a subdirectory within the notebooks directory.

🧹 Cleaning Up

See the main Installation Guide about how to deactivate or delete the virtual environment.

⚠️ Troubleshooting

  • If you get an ImportError, doublecheck that you installed the kernel in Step 5. If necessary, choose the openvinoenv kernel from the _Kernel->Change Kernel menu)
Clone this wiki locally