googledatalab / datalab

Interactive tools and developer experiences for Big Data on Google Cloud Platform.
Apache License 2.0
975 stars 249 forks source link

Unable to install IPyLeaflet in custom Datalab container #1326

Open tylere opened 7 years ago

tylere commented 7 years ago

IPyLeaflet is a package that adds interactive mapping to a notebook. The package can be successfully installed by running pip inside a notebook (see output below), but Datalab fails when running a custom container that installs IPyLeaflet as a Dockerfile command "RUN pip install ipyleaflet" (see output below).

I suspect that the failure is caused by Datalab pinning the notebook package to version 4.2.3. The successful manual pip install upgrades the notebook version to 5.0.0. Datalab Issue #1083 notes that the notebook package is pinned to version 4.2.3 because the nb2kg Session Manager had not been updated to match changes made to Jupyter. Since that comment, the nb2kg extension has been updated to account for the Jupyter changes.

Output of in-notebook installation with !pip install ipyleaflet

Collecting ipyleaflet Downloading ipyleaflet-0.3.0-py2.py3-none-any.whl (1.1MB) 100% |################################| 1.1MB 1.0MB/s Requirement already satisfied: ipywidgets>=6.0.0 in /usr/local/lib/python2.7/dist-packages (from ipyleaflet) Requirement already satisfied: ipykernel>=4.5.1 in /usr/local/lib/python2.7/dist-packages (from ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: widgetsnbextension~=2.0.0 in /usr/local/lib/python2.7/dist-packages (from ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: ipython>=4.0.0 in /usr/local/lib/python2.7/dist-packages (from ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: nbformat>=4.2.0 in /usr/local/lib/python2.7/dist-packages (from ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: traitlets>=4.3.1 in /usr/local/lib/python2.7/dist-packages (from ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: jupyter-client in /usr/local/lib/python2.7/dist-packages (from ipykernel>=4.5.1->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: tornado>=4.0 in /usr/local/lib/python2.7/dist-packages (from ipykernel>=4.5.1->ipywidgets>=6.0.0->ipyleaflet) Collecting notebook>=4.4.1 (from widgetsnbextension~=2.0.0->ipywidgets>=6.0.0->ipyleaflet) Downloading notebook-5.0.0-py2.py3-none-any.whl (6.9MB) 100% |################################| 6.9MB 167kB/s Requirement already satisfied: pygments in /usr/local/lib/python2.7/dist-packages (from ipython>=4.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: prompt-toolkit<2.0.0,>=1.0.4 in /usr/local/lib/python2.7/dist-packages (from ipython>=4.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: setuptools>=18.5 in /usr/local/lib/python2.7/dist-packages (from ipython>=4.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: backports.shutil-get-terminal-size; python_version == "2.7" in /usr/local/lib/python2.7/dist-packages (from ipython>=4.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: pickleshare in /usr/local/lib/python2.7/dist-packages (from ipython>=4.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: decorator in /usr/local/lib/python2.7/dist-packages (from ipython>=4.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: pexpect; sys_platform != "win32" in /usr/local/lib/python2.7/dist-packages (from ipython>=4.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: pathlib2; python_version == "2.7" or python_version == "3.3" in /usr/local/lib/python2.7/dist-packages (from ipython>=4.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: simplegeneric>0.8 in /usr/local/lib/python2.7/dist-packages (from ipython>=4.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: jupyter-core in /usr/local/lib/python2.7/dist-packages (from nbformat>=4.2.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: jsonschema!=2.5.0,>=2.4 in /usr/local/lib/python2.7/dist-packages (from nbformat>=4.2.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: ipython-genutils in /usr/local/lib/python2.7/dist-packages (from nbformat>=4.2.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: six in /usr/local/lib/python2.7/dist-packages (from traitlets>=4.3.1->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: enum34; python_version == "2.7" in /usr/local/lib/python2.7/dist-packages (from traitlets>=4.3.1->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: pyzmq>=13 in /usr/local/lib/python2.7/dist-packages (from jupyter-client->ipykernel>=4.5.1->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python2.7/dist-packages (from jupyter-client->ipykernel>=4.5.1->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: singledispatch in /usr/local/lib/python2.7/dist-packages (from tornado>=4.0->ipykernel>=4.5.1->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: certifi in /usr/local/lib/python2.7/dist-packages (from tornado>=4.0->ipykernel>=4.5.1->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: backports_abc>=0.4 in /usr/local/lib/python2.7/dist-packages (from tornado>=4.0->ipykernel>=4.5.1->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: jinja2 in /usr/local/lib/python2.7/dist-packages (from notebook>=4.4.1->widgetsnbextension~=2.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: terminado>=0.3.3; sys_platform != "win32" in /usr/local/lib/python2.7/dist-packages (from notebook>=4.4.1->widgetsnbextension~=2.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: nbconvert in /usr/local/lib/python2.7/dist-packages (from notebook>=4.4.1->widgetsnbextension~=2.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: wcwidth in /usr/local/lib/python2.7/dist-packages (from prompt-toolkit<2.0.0,>=1.0.4->ipython>=4.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: packaging>=16.8 in /usr/local/lib/python2.7/dist-packages (from setuptools>=18.5->ipython>=4.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: appdirs>=1.4.0 in /usr/local/lib/python2.7/dist-packages (from setuptools>=18.5->ipython>=4.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python2.7/dist-packages (from pexpect; sys_platform != "win32"->ipython>=4.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: scandir; python_version < "3.5" in /usr/local/lib/python2.7/dist-packages (from pathlib2; python_version == "2.7" or python_version == "3.3"->ipython>=4.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: functools32; python_version == "2.7" in /usr/local/lib/python2.7/dist-packages (from jsonschema!=2.5.0,>=2.4->nbformat>=4.2.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: MarkupSafe in /usr/local/lib/python2.7/dist-packages (from jinja2->notebook>=4.4.1->widgetsnbextension~=2.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/lib/python2.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=2.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: testpath in /usr/local/lib/python2.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=2.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: entrypoints>=0.2.2 in /usr/local/lib/python2.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=2.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: mistune!=0.6 in /usr/local/lib/python2.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=2.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: bleach in /usr/local/lib/python2.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=2.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: pyparsing in /usr/local/lib/python2.7/dist-packages (from packaging>=16.8->setuptools>=18.5->ipython>=4.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: configparser>=3.5; python_version == "2.7" in /usr/local/lib/python2.7/dist-packages (from entrypoints>=0.2.2->nbconvert->notebook>=4.4.1->widgetsnbextension~=2.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: html5lib>=0.99999999 in /usr/local/lib/python2.7/dist-packages (from bleach->nbconvert->notebook>=4.4.1->widgetsnbextension~=2.0.0->ipywidgets>=6.0.0->ipyleaflet) Requirement already satisfied: webencodings in /usr/local/lib/python2.7/dist-packages (from html5lib>=0.99999999->bleach->nbconvert->notebook>=4.4.1->widgetsnbextension~=2.0.0->ipywidgets>=6.0.0->ipyleaflet) Installing collected packages: ipyleaflet, notebook Found existing installation: notebook 4.2.3 Uninstalling notebook-4.2.3: Successfully uninstalled notebook-4.2.3 Successfully installed ipyleaflet-0.3.0 notebook-5.0.0

excerpt of logs from custom Datalab container /var/log/containers/datalab-server-datalab-ee-ipyleaflet_default_datalab-3b e16674d157eb598fd1cd15955fed314a183f538ec0cb7cd6557f453ea3e848.log

{"log":"Open your browser to http://localhost:8081/ to connect to Datalab.\n","stream":"stdout","time":"2017-04-20T 17:47:58.046544352Z"} {"log":"{\"name\":\"app\",\"hostname\":\"datalab-server-datalab-ee-ipyleaflet\",\"pid\":102,\"level\":50,\"err\":{\ "message\":\"read ECONNRESET\",\"name\":\"Error\",\"stack\":\"Error: read ECONNRESET\n at exports._errnoExcepti on (util.js:1022:11)\n at TCP.onread (net.js:569:26)\",\"code\":\"ECONNRESET\"},\"msg\":\"Jupyter server return ed error.\",\"time\":\"2017-04-20T17:48:05.867Z\",\"v\":0}\n","stream":"stderr","time":"2017-04-20T17:48:05.8695457 36Z"}

chmeyers commented 7 years ago

Bradley, can you see if we can unpin our notebook from 4.2.3?

yebrahim commented 7 years ago

This is not straightforward. Going from 4.2.3 to 5.0.0 is a very significant jump, and we need a lot of testing to make sure nothing breaks.

You don't need notebook==5.0.0 though, all you need is 4.4.1. Look at this line:

Collecting notebook>=4.4.1 (from widgetsnbextension~=2.0.0->ipywidgets>=6.0.0->ipyleaflet)

We might be able to make this jump easily. Please feel free to submit a PR for this if you would like to contribute. Otherwise I can pick this up at some point but I can't commit to it now.

tylere commented 7 years ago

PR opened: https://github.com/googledatalab/datalab/pull/1375