我想知道为什么 Iphython.display Geojson 中的复制粘贴示例不会导入到 Jupyter 笔记本中。
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,
})
上面的例子给出了错误:
---------------------------------------------------------------------------
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
这些是已安装的版本:
ipykernel (4.5.2)
ipython (5.1.0)
ipython-genutils (0.1.0)
ipywidgets (5.2.2)
根据他们的 git 讨论,应该添加它,对吗?:https://github.com/ipython/ipython/pull/10253
我究竟做错了什么?先感谢您!