【问题标题】:Gmaps does not show up in SpyderGmaps 不显示在 Spyder 中
【发布时间】:2019-08-03 22:29:04
【问题描述】:

我正在运行一个简单的示例:

import gmaps
import gmaps.datasets

gmaps.configure(api_key="...")
earthquake_df = gmaps.datasets.load_dataset_as_df( 'earthquakes' ) 
locations = earthquake_df[[ 'latitude' , 'longitude' ]] 
weights = earthquake_df[ 'magnitude' ] 
fig = gmaps.figure() 
fig.add_layer(gmaps.heatmap_layer(locations, weights=weights)) 
fig

但输出没有看到热图,而是显示:

Figure(layout=FigureLayout(height='420px'))

我正在使用 Spyder (Python 3.7)

【问题讨论】:

    标签: google-maps anaconda spyder python-3.7


    【解决方案1】:

    (这里是 Spyder 维护者) 原因很简单:Spyder 无法在其控制台上显示 Web 内容。网络内容是指只能在网络浏览器中呈现的内容。 gmaps 包就是这种情况。

    【讨论】:

    • 我明白了。有没有解决的办法?另外,为什么我在这里被否决?这是个坏问题吗?
    • 不,目前没有解决方法。而且您可能被否决了,因为您的问题对其他人来说不够清楚。
    • 我现在用的是folium。它也不渲染。但至少我可以将它导出为 html 。
    • @CarlosCordoba 是否有任何替代 gmaps 包来获取在 Spyder 中工作的谷歌地图?
    • @MariuszSiatka,我不这么认为。但是,我们计划在 Spyder 5(将于 2020 年发布)上添加 Web 内容查看器,这应该可以解决此问题。
    猜你喜欢
    • 2023-03-19
    • 1970-01-01
    • 2019-04-12
    • 2020-07-02
    • 2018-03-02
    • 2022-01-26
    • 1970-01-01
    • 1970-01-01
    • 2018-10-01
    相关资源
    最近更新 更多