Geojson in Ipython display cannot be imported in jupyter notebook

送分小仙女□ 提交于 2019-12-13 16:05:42

问题


I'd like to know why the copy-pasted example from the Iphython.display Geojson won't import in Jupyter notebook.

from IPython.display import GeoJSON

GeoJSON(data={
     "type": "Feature",
     "geometry": {
         "type": "Point",
         "coordinates": [-81.327, 296.038]
     }
 },
 url_template="http://s3-eu-west-1.amazonaws.com/whereonmars.cartodb.net/{basemap_id}/{z}/{x}/{y}.png",
 layer_options={
     "basemap_id": "celestia_mars-shaded-16k_global",
     "attribution" : "Celestia/praesepe",
     "minZoom" : 0,
     "maxZoom" : 18,
 })

The above example gives the error:

    ---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-6-138cfbb20fb9> in <module>()
----> 1 from IPython.display import GeoJSON
      2 
      3 GeoJSON(data={
      4      "type": "Feature",
      5      "geometry": {

ImportError: cannot import name GeoJSON

Using pip list these are the installed versions:

ipykernel (4.5.2)
ipython (5.1.0)
ipython-genutils (0.1.0)
ipywidgets (5.2.2)

According to their git discussion it should be added right?: https://github.com/ipython/ipython/pull/10253

What am I doing wrong? Thank you in advance!

来源:https://stackoverflow.com/questions/45558954/geojson-in-ipython-display-cannot-be-imported-in-jupyter-notebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!