jupyter笔记本中无法导入Ipython显示中的Geojson

2023-12-10

我想知道为什么 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

我究竟做错了什么?先感谢您!


None

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

jupyter笔记本中无法导入Ipython显示中的Geojson 的相关文章

随机推荐