mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-11 03:52:56 +00:00
Set PYSPARK_HOME in python2 kernelspec
* Install python2 spec to CONDA_DIR instead of system prefix too (c) Copyright IBM Corp. 2016
This commit is contained in:
@@ -90,12 +90,11 @@ RUN conda install --yes \
|
|||||||
RUN mkdir -p /opt/conda/share/jupyter/kernels/scala
|
RUN mkdir -p /opt/conda/share/jupyter/kernels/scala
|
||||||
COPY kernel.json /opt/conda/share/jupyter/kernels/scala/
|
COPY kernel.json /opt/conda/share/jupyter/kernels/scala/
|
||||||
|
|
||||||
USER root
|
# Install Python 2 kernel spec into the Python 3 conda environment which
|
||||||
|
# runs the notebook server
|
||||||
# Install Python 2 kernel spec globally to avoid permission problems when NB_UID
|
RUN bash -c '. activate python2 && \
|
||||||
# switching at runtime.
|
python -m ipykernel.kernelspec --prefix=$CONDA_DIR && \
|
||||||
RUN $CONDA_DIR/envs/python2/bin/python \
|
. deactivate'
|
||||||
$CONDA_DIR/envs/python2/bin/ipython \
|
# Set PYSPARK_HOME in the python2 spec
|
||||||
kernelspec install-self
|
RUN sed -i '$ d' $CONDA_DIR/share/jupyter/kernels/python2/kernel.json && \
|
||||||
|
echo ', "env": {"PYSPARK_PYTHON": "/opt/conda/envs/python2/bin/python"} }' >> $CONDA_DIR/share/jupyter/kernels/python2/kernel.json
|
||||||
USER jovyan
|
|
||||||
|
@@ -52,13 +52,11 @@ RUN conda create -p $CONDA_DIR/envs/python2 python=2.7 \
|
|||||||
pyzmq \
|
pyzmq \
|
||||||
&& conda clean -yt
|
&& conda clean -yt
|
||||||
|
|
||||||
USER root
|
# Install Python 2 kernel spec into the Python 3 conda environment which
|
||||||
|
# runs the notebook server
|
||||||
# Install Python 2 kernel spec globally to avoid permission problems when NB_UID
|
RUN bash -c '. activate python2 && \
|
||||||
# switching at runtime.
|
python -m ipykernel.kernelspec --prefix=$CONDA_DIR && \
|
||||||
RUN $CONDA_DIR/envs/python2/bin/python \
|
. deactivate'
|
||||||
$CONDA_DIR/envs/python2/bin/ipython \
|
# Set PYSPARK_HOME in the python2 spec
|
||||||
kernelspec install-self
|
RUN sed -i '$ d' $CONDA_DIR/share/jupyter/kernels/python2/kernel.json && \
|
||||||
|
echo ', "env": {"PYSPARK_PYTHON": "/opt/conda/envs/python2/bin/python"} }' >> $CONDA_DIR/share/jupyter/kernels/python2/kernel.json
|
||||||
USER jovyan
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user