Gmaps does not show up in Spyder

大憨熊 提交于 2021-02-09 09:01:37

问题


I am running a simple example:

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

but instead of seeing a heatmap, the output shows this:

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

I am using Spyder (Python 3.7)


回答1:


(Spyder maintainer here) The reason is very simple: Spyder can't show web content on its consoles. By web content I mean content that can only be rendered in a web browser. and that's the case for the gmaps package.



来源:https://stackoverflow.com/questions/55138615/gmaps-does-not-show-up-in-spyder

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