Open mikhail-khodorovskiy opened 4 years ago
If I check inside the docker process the package IS installed but it's still not available in the notebook:
sa_117223812809297213569@hsq-dev-mikhail-datalab ~ $ docker exec -it b83fe2367636 bash
root@b83fe2367636:/# pip install xlrd
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Requirement already satisfied: xlrd in /usr/local/lib/python2.7/site-packages (1.2.0)
It turns out the pip in the default path of the Docker image IS NOT the pip used for the notebook environments to the documentation to add custom libraries and the example is wrong: https://cloud.google.com/datalab/docs/how-to/adding-libraries
The docker file should look like this:
FROM gcr.io/cloud-datalab/datalab:latest
# The following line will install package xlrd, as an example
COPY requirements.txt .
RUN /usr/local/envs/py2env/bin/pip install -r requirements.txt
RUN /usr/local/envs/py3env/bin/pip install -r requirements.txt
Please update the documentation and the example Docker file.
I used the example Docker file: https://github.com/googledatalab/datalab/blob/master/containers/datalab/Dockerfile-extended-example.in to install xlrd library.
My docker image build executes and the library is being added to the image:
However when I try to use the library in my notebook, it does not seem to be available using both Python 2 and 3 kernels: