首页 > 解决方案 > 错误:从 Google Coblab 中的 osmnx folium 加载背景地图时出现“localhost 拒绝连接”

问题描述

我正在使用谷歌 Colab。ox.plot_graph_folium我正在尝试通过osmnx的内置函数将背景图添加到网络图。

但是,地图没有显示出来。

我的代码:

graph_map = ox.plot_graph_folium(G, popup_attribute='name', edge_width=2)
# save as html file then display map as an iframe
filepath = 'stockholm.html'
graph_map.save(filepath)
IFrame(filepath, width=900, height=500)

错误信息:

localhost 拒绝连接。

在此处输入图像描述

尝试修复它

我已经阅读了一个可能与 StackOverflow 相关的问题(此处)。老实说,我是个业余爱好者。我真的不明白代码的含义。但是,我仍然尝试过,但它仍然不起作用。

!ln -s /usr/local/share/jupyter/nbextensions /nbextensions
%cd /nbextensions

任何帮助,将不胜感激。

标签: pythongoogle-colaboratoryosmnx

解决方案


推荐阅读