Python 3.6中没有名为'folium.plugins'的模块 [英] No module named 'folium.plugins', Python 3.6

查看:353
本文介绍了Python 3.6中没有名为'folium.plugins'的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将folium导入到我正在研究的Jupyter笔记本中,但似乎无法解决Folium库的导入问题.还有其他人解决过这个问题吗?

I am trying to import folium into a Jupyter notebook I'm working on and I cannot seem to solve the import issues with the Folium library. Has anyone else solved this problem?

在安装folium时遇到错误,我使用了该线程中提供的解决方案来安装模块:

After encountering an error installing folium, I used the solution provided in this thread to install the module:

找不到Python 3.6模块:Folium

简短摘要:从github克隆,使用命令行安装.

Short summary: clone from github, install using the commandline.

这可行,但是当我尝试将大叶草导入笔记本时,我却在一行中遇到了以下错误:

This worked, but instead I encountered the following error further down the line when trying to import folium into my notebook:

输入:

import pandas as pd
import geopandas as gpd
import numpy as np
from geopandas.tools import sjoin
import folium
from folium.plugins import MarkerCluster
from folium.element import IFrame
import shapely
from shapely.geometry import Point
import unicodedata
import pysal as ps

输出:

ModuleNotFoundError                       Traceback (most recent call 
last)
<ipython-input-162-0ae99a5c599e> in <module>()
      4 from geopandas.tools import sjoin
      5 import folium
----> 6 from folium.plugins import MarkerCluster
      7 from folium.element import IFrame
      8 import shapely

ModuleNotFoundError: No module named 'folium.plugins'

推荐答案

我不知道为什么会这样,但是我遇到了同样的问题,最后用

I have no idea why this works, but I was having the same problem and finally solved it with

import folium.plugins as plugins

cluster = folium.FeatureGroup(name='cluster')
cluster.add_child(plugins.MarkerCluster(locations=coords, popups=popups)

这篇关于Python 3.6中没有名为'folium.plugins'的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆