地图不显示在 Spyder 中

Gmaps does not show up in Spyder

我是运行一个简单的例子:

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)

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