From 32b3d2bec23bc46fab1ed324f04a0ad7a7c73747 Mon Sep 17 00:00:00 2001 From: Min RK Date: Thu, 10 Aug 2017 16:08:30 +0200 Subject: [PATCH] Remove Python 2 Only Python 3 from now on --- all-spark-notebook/README.md | 26 +++++------------- base-notebook/README.md | 14 ++++++++-- datascience-notebook/README.md | 26 +++++------------- minimal-notebook/README.md | 14 ++++++++-- pyspark-notebook/README.md | 27 +++++-------------- scipy-notebook/Dockerfile | 48 +--------------------------------- scipy-notebook/README.md | 26 +++++------------- tensorflow-notebook/Dockerfile | 5 ---- tensorflow-notebook/README.md | 24 +++++------------ 9 files changed, 57 insertions(+), 153 deletions(-) diff --git a/all-spark-notebook/README.md b/all-spark-notebook/README.md index 344d03cce9..f543b3b4a9 100644 --- a/all-spark-notebook/README.md +++ b/all-spark-notebook/README.md @@ -6,7 +6,7 @@ ## What it Gives You * Jupyter Notebook 4.3.x -* Conda Python 3.x and Python 2.7.x environments +* Conda Python 3.x environment * Conda R 3.3.x environment * Scala 2.11.x * pyspark, pandas, matplotlib, scipy, seaborn, scikit-learn pre-installed for Python @@ -270,33 +270,19 @@ For additional information about using SSL, see the following: * The [Jupyter Notebook documentation](https://jupyter-notebook.readthedocs.io/en/latest/public_server.html#using-ssl-for-encrypted-communication) for best practices about running a public notebook server in general, most of which are encoded in this image. - ## Conda Environments -The default Python 3.x [Conda environment](http://conda.pydata.org/docs/using/envs.html) resides in `/opt/conda`. A second Python 2.x Conda environment exists in `/opt/conda/envs/python2`. You can [switch to the python2 environment](http://conda.pydata.org/docs/using/envs.html#change-environments-activate-deactivate) in a shell by entering the following: - -``` -source activate python2 -``` - -You can return to the default environment with this command: +The default Python 3.x [Conda environment](http://conda.pydata.org/docs/using/envs.html) resides in `/opt/conda`. -``` -source deactivate -``` - -The commands `jupyter`, `ipython`, `python`, `pip`, `easy_install`, and `conda` (among others) are available in both environments. For convenience, you can install packages into either environment regardless of what environment is currently active using commands like the following: +The commands `jupyter`, `ipython`, `python`, `pip`, and `conda` (among others) are available in both environments. For convenience, you can install packages into either environment regardless of what environment is currently active using commands like the following: ``` -# install a package into the python2 environment -pip2 install some-package -conda install -n python2 some-package - # install a package into the default (python 3.x) environment -pip3 install some-package -conda install -n python3 some-package +pip install some-package +conda install some-package ``` + ## Alternative Commands ### start-singleuser.sh diff --git a/base-notebook/README.md b/base-notebook/README.md index dec01eba31..1bec5df8cf 100644 --- a/base-notebook/README.md +++ b/base-notebook/README.md @@ -88,9 +88,19 @@ For additional information about using SSL, see the following: * The [jupyter_notebook_config.py](jupyter_notebook_config.py) file for how this Docker image generates a self-signed certificate. * The [Jupyter Notebook documentation](https://jupyter-notebook.readthedocs.io/en/latest/public_server.html#using-ssl-for-encrypted-communication) for best practices about running a public notebook server in general, most of which are encoded in this image. -## Conda Environment -The default Python 3.x [Conda environment](http://conda.pydata.org/docs/using/envs.html) resides in `/opt/conda`. The commands `ipython`, `python`, `pip`, `easy_install`, and `conda` (among others) are available in this environment. +## Conda Environments + +The default Python 3.x [Conda environment](http://conda.pydata.org/docs/using/envs.html) resides in `/opt/conda`. + +The commands `jupyter`, `ipython`, `python`, `pip`, and `conda` (among others) are available in both environments. For convenience, you can install packages into either environment regardless of what environment is currently active using commands like the following: + +``` +# install a package into the default (python 3.x) environment +pip install some-package +conda install some-package +``` + ## Alternative Commands diff --git a/datascience-notebook/README.md b/datascience-notebook/README.md index 6faaae0977..af2e03b17c 100644 --- a/datascience-notebook/README.md +++ b/datascience-notebook/README.md @@ -5,7 +5,7 @@ ## What it Gives You * Jupyter Notebook 5.0.x -* Conda Python 3.x and Python 2.7.x environments +* Conda Python 3.x environment * pandas, matplotlib, scipy, seaborn, scikit-learn, scikit-image, sympy, cython, patsy, statsmodel, cloudpickle, dill, numba, bokeh pre-installed * Conda R v3.3.x and channel * plyr, devtools, shiny, rmarkdown, forecast, rsqlite, reshape2, nycflights13, caret, rcurl, and randomforest pre-installed @@ -90,32 +90,20 @@ For additional information about using SSL, see the following: * The [jupyter_notebook_config.py](jupyter_notebook_config.py) file for how this Docker image generates a self-signed certificate. * The [Jupyter Notebook documentation](https://jupyter-notebook.readthedocs.io/en/latest/public_server.html#using-ssl-for-encrypted-communication) for best practices about running a public notebook server in general, most of which are encoded in this image. -## Conda Environments - -The default Python 3.x [Conda environment](http://conda.pydata.org/docs/using/envs.html) resides in `/opt/conda`. A second Python 2.x Conda environment exists in `/opt/conda/envs/python2`. You can [switch to the python2 environment](http://conda.pydata.org/docs/using/envs.html#change-environments-activate-deactivate) in a shell by entering the following: - -``` -source activate python2 -``` -You can return to the default environment with this command: +## Conda Environments -``` -source deactivate -``` +The default Python 3.x [Conda environment](http://conda.pydata.org/docs/using/envs.html) resides in `/opt/conda`. -The commands `jupyter`, `ipython`, `python`, `pip`, `easy_install`, and `conda` (among others) are available in both environments. For convenience, you can install packages into either environment regardless of what environment is currently active using commands like the following: +The commands `jupyter`, `ipython`, `python`, `pip`, and `conda` (among others) are available in both environments. For convenience, you can install packages into either environment regardless of what environment is currently active using commands like the following: ``` -# install a package into the python2 environment -pip2 install some-package -conda install -n python2 some-package - # install a package into the default (python 3.x) environment -pip3 install some-package -conda install -n python3 some-package +pip install some-package +conda install some-package ``` + ## Alternative Commands ### start-singleuser.sh diff --git a/minimal-notebook/README.md b/minimal-notebook/README.md index 99ee9ed2bf..63c18b5018 100644 --- a/minimal-notebook/README.md +++ b/minimal-notebook/README.md @@ -89,9 +89,19 @@ For additional information about using SSL, see the following: * The [jupyter_notebook_config.py](jupyter_notebook_config.py) file for how this Docker image generates a self-signed certificate. * The [Jupyter Notebook documentation](https://jupyter-notebook.readthedocs.io/en/latest/public_server.html#using-ssl-for-encrypted-communication) for best practices about running a public notebook server in general, most of which are encoded in this image. -## Conda Environment -The default Python 3.x [Conda environment](http://conda.pydata.org/docs/using/envs.html) resides in `/opt/conda`. The commands `ipython`, `python`, `pip`, `easy_install`, and `conda` (among others) are available in this environment. +## Conda Environments + +The default Python 3.x [Conda environment](http://conda.pydata.org/docs/using/envs.html) resides in `/opt/conda`. + +The commands `jupyter`, `ipython`, `python`, `pip`, and `conda` (among others) are available in both environments. For convenience, you can install packages into either environment regardless of what environment is currently active using commands like the following: + +``` +# install a package into the default (python 3.x) environment +pip install some-package +conda install some-package +``` + ## Alternative Commands diff --git a/pyspark-notebook/README.md b/pyspark-notebook/README.md index a642935839..b0b0aac717 100644 --- a/pyspark-notebook/README.md +++ b/pyspark-notebook/README.md @@ -5,7 +5,7 @@ ## What it Gives You * Jupyter Notebook 5.0.x -* Conda Python 3.x and Python 2.7.x environments +* Conda Python 3.x environment * pyspark, pandas, matplotlib, scipy, seaborn, scikit-learn pre-installed * Spark 2.2.0 with Hadoop 2.7 for use in local mode or to connect to a cluster of Spark workers * Mesos client 1.2 binary that can communicate with a Mesos master @@ -162,34 +162,19 @@ For additional information about using SSL, see the following: * The [Jupyter Notebook documentation](https://jupyter-notebook.readthedocs.io/en/latest/public_server.html#using-ssl-for-encrypted-communication) for best practices about running a public notebook server in general, most of which are encoded in this image. - - ## Conda Environments -The default Python 3.x [Conda environment](http://conda.pydata.org/docs/using/envs.html) resides in `/opt/conda`. A second Python 2.x Conda environment exists in `/opt/conda/envs/python2`. You can [switch to the python2 environment](http://conda.pydata.org/docs/using/envs.html#change-environments-activate-deactivate) in a shell by entering the following: - -``` -source activate python2 -``` +The default Python 3.x [Conda environment](http://conda.pydata.org/docs/using/envs.html) resides in `/opt/conda`. -You can return to the default environment with this command: +The commands `jupyter`, `ipython`, `python`, `pip`, and `conda` (among others) are available in both environments. For convenience, you can install packages into either environment regardless of what environment is currently active using commands like the following: ``` -source deactivate -``` - -The commands `jupyter`, `ipython`, `python`, `pip`, `easy_install`, and `conda` (among others) are available in both environments. For convenience, you can install packages into either environment regardless of what environment is currently active using commands like the following: - -``` -# install a package into the python2 environment -pip2 install some-package -conda install -n python2 some-package - # install a package into the default (python 3.x) environment -pip3 install some-package -conda install -n python3 some-package +pip install some-package +conda install some-package ``` + ## Alternative Commands ### start-singleuser.sh diff --git a/scipy-notebook/Dockerfile b/scipy-notebook/Dockerfile index 1538a18e54..8f528eef8b 100644 --- a/scipy-notebook/Dockerfile +++ b/scipy-notebook/Dockerfile @@ -47,54 +47,8 @@ RUN conda install --quiet --yes \ # Activate ipywidgets extension in the environment that runs the notebook server RUN jupyter nbextension enable --py widgetsnbextension --sys-prefix -# Install Python 2 packages -# Remove pyqt and qt pulled in for matplotlib since we're only ever going to -# use notebook-friendly backends in these images -RUN conda create --quiet --yes -p $CONDA_DIR/envs/python2 python=2.7 \ - 'nomkl' \ - 'ipython=5.3*' \ - 'ipywidgets=6.0*' \ - 'pandas=0.19*' \ - 'numexpr=2.6*' \ - 'matplotlib=2.0*' \ - 'scipy=0.19*' \ - 'seaborn=0.7*' \ - 'scikit-learn=0.18*' \ - 'scikit-image=0.12*' \ - 'sympy=1.0*' \ - 'cython=0.25*' \ - 'patsy=0.4*' \ - 'statsmodels=0.8*' \ - 'cloudpickle=0.2*' \ - 'dill=0.2*' \ - 'numba=0.31*' \ - 'bokeh=0.12*' \ - 'hdf5=1.8.17' \ - 'h5py=2.6*' \ - 'sqlalchemy=1.1*' \ - 'pyzmq' \ - 'vincent=0.4.*' \ - 'beautifulsoup4=4.5.*' \ - 'xlrd' && \ - conda remove -n python2 --quiet --yes --force qt pyqt && \ - conda clean -tipsy -# Add shortcuts to distinguish pip for python2 and python3 envs -RUN ln -s $CONDA_DIR/envs/python2/bin/pip $CONDA_DIR/bin/pip2 && \ - ln -s $CONDA_DIR/bin/pip $CONDA_DIR/bin/pip3 - # Import matplotlib the first time to build the font cache. ENV XDG_CACHE_HOME /home/$NB_USER/.cache/ -RUN MPLBACKEND=Agg $CONDA_DIR/envs/python2/bin/python -c "import matplotlib.pyplot" - -USER root - -# Install Python 2 kernel spec globally to avoid permission problems when NB_UID -# switching at runtime and to allow the notebook server running out of the root -# environment to find it. Also, activate the python2 environment upon kernel -# launch. -RUN 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 MPLBACKEND=Agg python -c "import matplotlib.pyplot" USER $NB_USER diff --git a/scipy-notebook/README.md b/scipy-notebook/README.md index acdb05728f..2d37dc1c01 100644 --- a/scipy-notebook/README.md +++ b/scipy-notebook/README.md @@ -5,7 +5,7 @@ ## What it Gives You * Jupyter Notebook 5.0.x -* Conda Python 3.x and Python 2.7.x environments +* Conda Python 3.x environment * pandas, matplotlib, scipy, seaborn, scikit-learn, scikit-image, sympy, cython, patsy, statsmodel, cloudpickle, dill, numba, bokeh, vincent, beautifulsoup, xlrd pre-installed * Unprivileged user `jovyan` (uid=1000, configurable, see options) in group `users` (gid=100) with ownership over `/home/jovyan` and `/opt/conda` * [tini](https://github.com/krallin/tini) as the container entrypoint and [start-notebook.sh](../base-notebook/start-notebook.sh) as the default command @@ -87,32 +87,20 @@ For additional information about using SSL, see the following: * The [jupyter_notebook_config.py](jupyter_notebook_config.py) file for how this Docker image generates a self-signed certificate. * The [Jupyter Notebook documentation](https://jupyter-notebook.readthedocs.io/en/latest/public_server.html#using-ssl-for-encrypted-communication) for best practices about running a public notebook server in general, most of which are encoded in this image. -## Conda Environments - -The default Python 3.x [Conda environment](http://conda.pydata.org/docs/using/envs.html) resides in `/opt/conda`. A second Python 2.x Conda environment exists in `/opt/conda/envs/python2`. You can [switch to the python2 environment](http://conda.pydata.org/docs/using/envs.html#change-environments-activate-deactivate) in a shell by entering the following: - -``` -source activate python2 -``` -You can return to the default environment with this command: +## Conda Environments -``` -source deactivate -``` +The default Python 3.x [Conda environment](http://conda.pydata.org/docs/using/envs.html) resides in `/opt/conda`. -The commands `jupyter`, `ipython`, `python`, `pip`, `easy_install`, and `conda` (among others) are available in both environments. For convenience, you can install packages into either environment regardless of what environment is currently active using commands like the following: +The commands `jupyter`, `ipython`, `python`, `pip`, and `conda` (among others) are available in both environments. For convenience, you can install packages into either environment regardless of what environment is currently active using commands like the following: ``` -# install a package into the python2 environment -pip2 install some-package -conda install -n python2 some-package - # install a package into the default (python 3.x) environment -pip3 install some-package -conda install -n python3 some-package +pip install some-package +conda install some-package ``` + ## Alternative Commands ### start-singleuser.sh diff --git a/tensorflow-notebook/Dockerfile b/tensorflow-notebook/Dockerfile index 71ddb67c58..158085562d 100644 --- a/tensorflow-notebook/Dockerfile +++ b/tensorflow-notebook/Dockerfile @@ -4,10 +4,5 @@ FROM jupyter/scipy-notebook MAINTAINER Jupyter Project -USER $NB_USER - # Install Python 3 Tensorflow RUN conda install --quiet --yes 'tensorflow=1.0*' - -# Install Python 2 Tensorflow -RUN conda install --quiet --yes -n python2 'tensorflow=1.0*' diff --git a/tensorflow-notebook/README.md b/tensorflow-notebook/README.md index 634af7fdd6..90ec316130 100644 --- a/tensorflow-notebook/README.md +++ b/tensorflow-notebook/README.md @@ -96,32 +96,20 @@ For additional information about using SSL, see the following: * The [jupyter_notebook_config.py](jupyter_notebook_config.py) file for how this Docker image generates a self-signed certificate. * The [Jupyter Notebook documentation](https://jupyter-notebook.readthedocs.io/en/latest/public_server.html#using-ssl-for-encrypted-communication) for best practices about running a public notebook server in general, most of which are encoded in this image. -## Conda Environments - -The default Python 3.x [Conda environment](http://conda.pydata.org/docs/using/envs.html) resides in `/opt/conda`. A second Python 2.x Conda environment exists in `/opt/conda/envs/python2`. You can [switch to the python2 environment](http://conda.pydata.org/docs/using/envs.html#change-environments-activate-deactivate) in a shell by entering the following: - -``` -source activate python2 -``` -You can return to the default environment with this command: +## Conda Environments -``` -source deactivate -``` +The default Python 3.x [Conda environment](http://conda.pydata.org/docs/using/envs.html) resides in `/opt/conda`. -The commands `jupyter`, `ipython`, `python`, `pip`, `easy_install`, and `conda` (among others) are available in both environments. For convenience, you can install packages into either environment regardless of what environment is currently active using commands like the following: +The commands `jupyter`, `ipython`, `python`, `pip`, and `conda` (among others) are available in both environments. For convenience, you can install packages into either environment regardless of what environment is currently active using commands like the following: ``` -# install a package into the python2 environment -pip2 install some-package -conda install -n python2 some-package - # install a package into the default (python 3.x) environment -pip3 install some-package -conda install -n python3 some-package +pip install some-package +conda install some-package ``` + ## Alternative Commands ### start-singleuser.sh