From 92ef9da523416dd5f56523266e3c225035382fec Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Fri, 11 Oct 2024 07:21:46 -0600 Subject: [PATCH] Fix Jupyter kernel Python versions --- r-session-complete/Dockerfile.ubuntu2204 | 7 ++++--- .../Dockerfile.ubuntu2204 | 7 ++++--- workbench-for-microsoft-azure-ml/Dockerfile.ubuntu2204 | 7 ++++--- workbench/Dockerfile.ubuntu2204 | 7 ++++--- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/r-session-complete/Dockerfile.ubuntu2204 b/r-session-complete/Dockerfile.ubuntu2204 index 46784c18..f16c595c 100644 --- a/r-session-complete/Dockerfile.ubuntu2204 +++ b/r-session-complete/Dockerfile.ubuntu2204 @@ -49,9 +49,10 @@ RUN /opt/python/"${PYTHON_VERSION}"/bin/python -m venv /opt/python/jupyter \ notebook \ pwb_jupyterlab~=1.0 \ && ln -s /opt/python/jupyter/bin/jupyter /usr/local/bin/jupyter \ - && /opt/python/jupyter/bin/python -m pip install ipykernel \ - && /opt/python/jupyter/bin/python -m ipykernel install --name py${PYTHON_VERSION} --display-name "Python ${PYTHON_VERSION}" \ - && /opt/python/jupyter/bin/python -m ipykernel install --name py${PYTHON_VERSION_ALT} --display-name "Python ${PYTHON_VERSION_ALT}" \ + && /opt/python/${PYTHON_VERSION}/bin/python -m pip install ipykernel \ + && /opt/python/${PYTHON_VERSION_ALT}/bin/python -m pip install ipykernel \ + && /opt/python/${PYTHON_VERSION}/bin/python -m ipykernel install --name py${PYTHON_VERSION} --display-name "Python ${PYTHON_VERSION}" \ + && /opt/python/${PYTHON_VERSION_ALT}/bin/python -m ipykernel install --name py${PYTHON_VERSION_ALT} --display-name "Python ${PYTHON_VERSION_ALT}" \ && /opt/python/jupyter/bin/python -m pip cache purge ENV PATH="/opt/python/jupyter/bin:${PATH}" diff --git a/workbench-for-google-cloud-workstations/Dockerfile.ubuntu2204 b/workbench-for-google-cloud-workstations/Dockerfile.ubuntu2204 index e0c638b9..1cea9f81 100644 --- a/workbench-for-google-cloud-workstations/Dockerfile.ubuntu2204 +++ b/workbench-for-google-cloud-workstations/Dockerfile.ubuntu2204 @@ -123,9 +123,10 @@ RUN /opt/python/"${PYTHON_VERSION_JUPYTER}"/bin/python -m venv /opt/python/jupyt notebook \ pwb_jupyterlab~=1.0 \ && ln -s /opt/python/jupyter/bin/jupyter /usr/local/bin/jupyter \ - && /opt/python/jupyter/bin/python -m pip install ipykernel \ - && /opt/python/jupyter/bin/python -m ipykernel install --name py${PYTHON_VERSION} --display-name "Python ${PYTHON_VERSION}" \ - && /opt/python/jupyter/bin/python -m ipykernel install --name py${PYTHON_VERSION_ALT} --display-name "Python ${PYTHON_VERSION_ALT}" \ + && /opt/python/${PYTHON_VERSION}/bin/python -m pip install ipykernel \ + && /opt/python/${PYTHON_VERSION_ALT}/bin/python -m pip install ipykernel \ + && /opt/python/${PYTHON_VERSION}/bin/python -m ipykernel install --name py${PYTHON_VERSION} --display-name "Python ${PYTHON_VERSION}" \ + && /opt/python/${PYTHON_VERSION_ALT}/bin/python -m ipykernel install --name py${PYTHON_VERSION_ALT} --display-name "Python ${PYTHON_VERSION_ALT}" \ && /opt/python/jupyter/bin/python3 -m pip cache purge ADD --chmod=755 https://raw.githubusercontent.com/rstudio/wait-for-it/master/wait-for-it.sh /usr/local/bin/wait-for-it.sh diff --git a/workbench-for-microsoft-azure-ml/Dockerfile.ubuntu2204 b/workbench-for-microsoft-azure-ml/Dockerfile.ubuntu2204 index abde1303..c13954a3 100644 --- a/workbench-for-microsoft-azure-ml/Dockerfile.ubuntu2204 +++ b/workbench-for-microsoft-azure-ml/Dockerfile.ubuntu2204 @@ -93,9 +93,10 @@ RUN /opt/python/"${PYTHON_VERSION_JUPYTER}"/bin/python -m venv /opt/python/jupyt notebook \ pwb_jupyterlab~=1.0 \ && ln -s /opt/python/jupyter/bin/jupyter /usr/local/bin/jupyter \ - && /opt/python/jupyter/bin/python -m pip install ipykernel \ - && /opt/python/jupyter/bin/python -m ipykernel install --name py${PYTHON_VERSION} --display-name "Python ${PYTHON_VERSION}" \ - && /opt/python/jupyter/bin/python -m ipykernel install --name py${PYTHON_VERSION_ALT} --display-name "Python ${PYTHON_VERSION_ALT}" \ + && /opt/python/${PYTHON_VERSION}/bin/python -m pip install ipykernel \ + && /opt/python/${PYTHON_VERSION_ALT}/bin/python -m pip install ipykernel \ + && /opt/python/${PYTHON_VERSION}/bin/python -m ipykernel install --name py${PYTHON_VERSION} --display-name "Python ${PYTHON_VERSION}" \ + && /opt/python/${PYTHON_VERSION_ALT}/bin/python -m ipykernel install --name py${PYTHON_VERSION_ALT} --display-name "Python ${PYTHON_VERSION_ALT}" \ && /opt/python/jupyter/bin/python3 -m pip cache purge ### Install basic data science packages for Python and R ### diff --git a/workbench/Dockerfile.ubuntu2204 b/workbench/Dockerfile.ubuntu2204 index 8a9c447b..ba25914a 100644 --- a/workbench/Dockerfile.ubuntu2204 +++ b/workbench/Dockerfile.ubuntu2204 @@ -85,9 +85,10 @@ RUN /opt/python/"${PYTHON_VERSION_JUPYTER}"/bin/python -m venv /opt/python/jupyt notebook \ pwb_jupyterlab~=1.0 \ && ln -s /opt/python/jupyter/bin/jupyter /usr/local/bin/jupyter \ - && /opt/python/jupyter/bin/python -m pip install ipykernel \ - && /opt/python/jupyter/bin/python -m ipykernel install --name py${PYTHON_VERSION} --display-name "Python ${PYTHON_VERSION}" \ - && /opt/python/jupyter/bin/python -m ipykernel install --name py${PYTHON_VERSION_ALT} --display-name "Python ${PYTHON_VERSION_ALT}" \ + && /opt/python/${PYTHON_VERSION}/bin/python -m pip install ipykernel \ + && /opt/python/${PYTHON_VERSION_ALT}/bin/python -m pip install ipykernel \ + && /opt/python/${PYTHON_VERSION}/bin/python -m ipykernel install --name py${PYTHON_VERSION} --display-name "Python ${PYTHON_VERSION}" \ + && /opt/python/${PYTHON_VERSION_ALT}/bin/python -m ipykernel install --name py${PYTHON_VERSION_ALT} --display-name "Python ${PYTHON_VERSION_ALT}" \ && /opt/python/jupyter/bin/python -m pip cache purge RUN curl -fsSL -o /usr/local/bin/wait-for-it.sh https://raw.githubusercontent.com/rstudio/wait-for-it/master/wait-for-it.sh && \