Skip to content

Commit

Permalink
BUG: Fix missing python 2 environment
Browse files Browse the repository at this point in the history
See also [#433](jupyter/docker-stacks#433) on jupyter/docker-stack.
Python 2 support is now removed from jupyter/datascience-notebook. Update dockerfile and config.yml to install python2 kernel manually.
  • Loading branch information
JoostJM committed Aug 16, 2017
1 parent cb17d65 commit 93d7d27
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ jobs:
command: |
apt-get update
apt-get install -y openssh-client openssh-server
- run:
# Jupyter datascience notebook does not support python 2 anymore, install it manually.
# See also https://github.com/jupyter/docker-stacks/issues/432
# Next, install python 2 kernel globally, so it can be found from the root
name: Install Python 2 Kernel
command: |
conda create -n python2 python=2 ipykernel
pip install kernda --no-cache
$CONDA_DIR/envs/python2/bin/python -m ipykernel install
kernda -o -y /usr/local/share/jupyter/kernels/python2/kernel.json
pip uninstall kernda -y
- run:
name: Install pyradiomics in Python 2 and 3
command: |
Expand Down Expand Up @@ -44,6 +55,3 @@ jobs:
jupyter nbconvert --ExecutePreprocessor.kernel_name=python2 --ExecutePreprocessor.timeout=-1 --to notebook --output-dir /tmp --execute notebooks/helloRadiomics.ipynb notebooks/helloFeatureClass.ipynb notebooks/PyRadiomicsExample.ipynb
jupyter nbconvert --ExecutePreprocessor.kernel_name=python3 --ExecutePreprocessor.timeout=-1 --to notebook --output-dir /tmp --execute notebooks/helloRadiomics.ipynb notebooks/helloFeatureClass.ipynb notebooks/PyRadiomicsExample.ipynb
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ LABEL org.label-schema.build-data=$BUILD_DATE \

USER root
ADD . /root/pyradiomics

# Jupyter datascience notebook does not support python 2 anymore, install it manually.
# If using cache, it is possible python2 environment exists from previous install, therefore
# only install if python2 environment does not exist
# See also https://github.com/jupyter/docker-stacks/issues/432
# Next, also install python 2 kernel globally, so it can be found from the root
RUN /bin/bash -c "source activate python2 \
|| (conda create -n python2 python=2 ipykernel \
&& pip install kernda --no-cache \
&& $CONDA_DIR/envs/python2/bin/python -m ipykernel install \
&& kernda -o -y /usr/local/share/jupyter/kernels/python2/kernel.json \
&& pip uninstall kernda -y)"

# Install in Python 3
RUN /bin/bash -c "source activate root \
&& cd /root/pyradiomics \
Expand Down

0 comments on commit 93d7d27

Please sign in to comment.