这是我的map.py代码:
import folium
map = folium.Map(location=[42.3601, -71.0589], zoom_start=12)
map.save('map.html')
这是错误:
File "map.py", line 2, in <module>
import folium File "/Users/tomerrajuan/Library/Python/2.7/lib/python/site-packages/folium/__init__.py",
line 8, in <module>
import branca File "/Users/tomerrajuan/Library/Python/2.7/lib/python/site-packages/branca/__init__.py",
line 1, in <module>
import branca.colormap as colormap File "/Users/tomerrajuan/Library/Python/2.7/lib/python/site-packages/branca/colormap.py",
line 15, in <module>
from branca.element import ENV, Figure, JavascriptLink, MacroElement File
"/Users/tomerrajuan/Library/Python/2.7/lib/python/site-packages/branca/element.py",
line 13, in <module>
from urllib.request import urlopen ImportError: No module named request
您将必须手动安装requests
软件包。
这可以通过在终端/ cmd中运行此命令来完成:
pip install requests