Contents
Introduction
Conda and Jupyter Lab are probably the best combination for easily managing packages and testing code snippets while prototyping, especially in the machine learning and deep learning fields. For instance, some models may require TensorFlow 1.15, others TensorFlow 2.0, older ones Caffe2, or some other framework, and with such a setup, you can easily switch environments and Python versions with a simple click.
Since I am working a lot with Docker on remote servers, I also need a ready-to-use Docker image. Therefore, I built an image integrating Jupyter, Conda, and a few small tools that I think provide the “best prototyping workspace” with very little effort. The davidelanz/jupyter docker image provides a quick, dockerized setup for Jupyter Lab with multiple Conda environments.
| Features | |
|---|---|
![]() | The image comes with jupyterlab_code_formatter already installed |
![]() | The image comes with LSP Python language server for JupyterLab (jedi 0.17.2) already installed |
![]() | The image already comes with a Python 3.7 Conda environment with OpenCV support called opencv-py3.7 |

Mount the image from DockerHub
Download the image from davidelanz/jupyter, then mount the container (the image exposes JupyterLab on the 8888 port):
docker pull davidelanz/jupyter
docker run \
-p <CONTANER_PORT>:8888 \
-v <EXTERNAL_FOLDER>:/workspace \
--name <CONTAINER_NAME> davidelanz/jupyterYour workspace will be available at http://localhost:<CONTAINER_PORT>.
Build from GitHub
The image can be directly built from the GitHub repository:
$ git clone https://github.com/davidelanz/jupyter-docker
$ cd jupyter-docker/
$ docker build . -t davidelanz/jupyterManage Conda environments
The image already comes with a Python 3.7 environment with OpenCV support called
opencv-py3.7.
You can create a new environment as follows (you can easily do it from the JupyterLab console):
conda create -y --name <DESIRED_ENV_NAME> python=<DESIRED_PYTHON_VERSION>Then you can load it to JupyterLab as follows:
conda activate <DESIRED_ENV_NAME> && \
conda install -y ipykernel && \
python -m ipykernel install --name <DESIRED_ENV_NAME> --userWith Jupyter installed, you can list the currently installed kernels with:
jupyter kernelspec listIf you want to uninstall an unwanted kernel:
jupyter kernelspec uninstall <UNWANTED_KERNEL>

