diff --git a/jupyterhub/base/Dockerfile b/jupyterhub/base/Dockerfile
index c474724b5fb7aaa95be9d9fd96a9bf198b849f8d..c8e927d630b3b6f8400c8abfbbbae69d619bd97d 100755
--- a/jupyterhub/base/Dockerfile
+++ b/jupyterhub/base/Dockerfile
@@ -9,8 +9,6 @@ RUN apt-get update && \
         curl && \
     apt-get clean
 
-ENV JUPYTERHUB_PYTHON_VERSION=3.8
-
 RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
     apt-get update && \
     apt-get install -y \
@@ -20,31 +18,31 @@ RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
         openjdk-11-jre-headless && \
     apt-get clean
 
-RUN python${JUPYTERHUB_PYTHON_VERSION} -m pip --no-cache-dir install \
+RUN python${PYTHON_VERSION} -m pip --no-cache-dir install \
         jupyterlab \
         jupyterhub \
         ipympl \
 	&& \
-    python${JUPYTERHUB_PYTHON_VERSION} -m jupyter labextension install \
+    python${PYTHON_VERSION} -m jupyter labextension install \
         @jupyter-widgets/jupyterlab-manager && \
-    python${JUPYTERHUB_PYTHON_VERSION} -m jupyter serverextension enable --sys-prefix --py jupyterlab && \
-    python${JUPYTERHUB_PYTHON_VERSION} -m jupyter labextension install \
+    python${PYTHON_VERSION} -m jupyter serverextension enable --sys-prefix --py jupyterlab && \
+    python${PYTHON_VERSION} -m jupyter labextension install \
         jupyter-webrtc \
         ipyvolume \
         jupyter-threejs \
         jupyterlab-execute-time \
     && \
-    python${JUPYTERHUB_PYTHON_VERSION} -m jupyter labextension install @ryantam626/jupyterlab_code_formatter && \
-    python${JUPYTERHUB_PYTHON_VERSION} -m pip --no-cache-dir install jupyterlab_code_formatter && \
-    python${JUPYTERHUB_PYTHON_VERSION} -m jupyter serverextension enable --sys-prefix --py jupyterlab_code_formatter && \
-    python${JUPYTERHUB_PYTHON_VERSION} -m pip --no-cache-dir install black isort && \
-    python${JUPYTERHUB_PYTHON_VERSION} -m pip --no-cache-dir install jupyterlab-git && \
-    python${JUPYTERHUB_PYTHON_VERSION} -m jupyter lab build
+    python${PYTHON_VERSION} -m jupyter labextension install @ryantam626/jupyterlab_code_formatter && \
+    python${PYTHON_VERSION} -m pip --no-cache-dir install jupyterlab_code_formatter && \
+    python${PYTHON_VERSION} -m jupyter serverextension enable --sys-prefix --py jupyterlab_code_formatter && \
+    python${PYTHON_VERSION} -m pip --no-cache-dir install black isort && \
+    python${PYTHON_VERSION} -m pip --no-cache-dir install jupyterlab-git && \
+    python${PYTHON_VERSION} -m jupyter lab build
 
 RUN mkdir -p /usr/local/venv && \
-    python${JUPYTERHUB_PYTHON_VERSION} -m venv /usr/local/venv/default && \
+    python${PYTHON_VERSION} -m venv /usr/local/venv/default && \
     . /usr/local/venv/default/bin/activate && \
-    python${JUPYTERHUB_PYTHON_VERSION} -m pip --no-cache-dir install --upgrade \
+    python${PYTHON_VERSION} -m pip --no-cache-dir install --upgrade \
         pip==${PYTHON_PIP_VERSION} \
         setuptools==${PYTHON_SETUPTOOLS_VERSION} && \
     pip --no-cache-dir install tensorflow==1.15.3 && \
diff --git a/ubuntu/Dockerfile b/ubuntu/Dockerfile
index e82b1c02f7ebe187f8527f6126cc00afb5e06ac2..9828e9f982d4f8cd7916392bdb097ed0edda0372 100644
--- a/ubuntu/Dockerfile
+++ b/ubuntu/Dockerfile
@@ -88,19 +88,21 @@ RUN apt-get update && \
         && \
     apt-get clean
 
-RUN apt-get install -y \
-        python3.8 \
-        python3.8-dev \
-        python3.8-venv \
-        && \
-    apt-get clean
-
 ADD agki-nas01.imp.fu-berlin.de-ca-cert.crt /usr/local/share/ca-certificates/agki-nas01.imp.fu-berlin.de-ca-cert.crt
 RUN update-ca-certificates
+
 COPY pip.conf /etc/
 
+ENV PYTHON_VERSION=3.8
 ENV PYTHON_PIP_VERSION=20.2.3
 ENV PYTHON_SETUPTOOLS_VERSION=50.3.0
-RUN python3 -m pip install --upgrade \
-    pip==${PYTHON_PIP_VERSION} \
-    setuptools==${PYTHON_SETUPTOOLS_VERSION}
+
+RUN apt-get install -y \
+        python${PYTHON_VERSION} \
+        python${PYTHON_VERSION}-dev \
+        python${PYTHON_VERSION}-venv \
+        && \
+    apt-get clean && \
+    python${PYTHON_VERSION} -m pip install --upgrade \
+        pip==${PYTHON_PIP_VERSION} \
+        setuptools==${PYTHON_SETUPTOOLS_VERSION}