No module named folium.plugins, Python 3.6

2024/9/19 20:41:48

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?

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

Python 3.6 Module cannot be found: Folium

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:

Input:

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

Output:

ModuleNotFoundError                       Traceback (most recent call 
last)
<ipython-input-162-0ae99a5c599e> in <module>()4 from geopandas.tools import sjoin5 import folium
----> 6 from folium.plugins import MarkerCluster7 from folium.element import IFrame8 import shapelyModuleNotFoundError: No module named 'folium.plugins'
Answer

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

import folium.plugins as pluginscluster = folium.FeatureGroup(name='cluster')
cluster.add_child(plugins.MarkerCluster(locations=coords, popups=popups)
https://en.xdnf.cn/q/72748.html

Related Q&A

How you enable CBC to return best solution when timelimit? (Pyomo)

I am trying to use CBC(v2.10.3) on Pyomo to solve for a integer linear problem.When executing the solver, I am currently setting a timelimit of 600s.opt = SolverFactory ("cbc")opt.options[sec…

SSL cert issue with Python Requests

Im making a request to a site which requires SSL cert to access. When I tried to access the URL, I get SSL Certificate errorimport requests proxies = {"https":"https://user:pwd@host:port…

MatplotLib get all annotation by axes

im doing a project with Python and Tkinter. I can plot an array of data and i also implemented a function to add annotation on plot when i click with the mouse, but now i need a list of all annotation…

Using Pandas to applymap with access to index/column?

Whats the most effective way to solve the following pandas problem? Heres a simplified example with some data in a data frame: import pandas as pd import numpy as np df = pd.DataFrame(np.random.randin…

Multiple URL segment in Flask and other Python frameowrks

Im building an application in both Bottle and Flask to see which I am more comfortable with as Django is too much batteries included.I have read through the routing documentation of both, which is very…

installing python modules that require gcc on shared hosting with no gcc or root access

Im using Hostgator shared as a production environment and I had a problem installing some python modules, after using:pip install MySQL-pythonpip install pillowresults in:unable to execute gcc: Permiss…

Using libclang to parse in C++ in Python

After some research and a few questions, I ended up exploring libclang library in order to parse C++ source files in Python.Given a C++ source int fac(int n) {return (n>1) ? n∗fac(n−1) : 1; }for …

Python one class per module and packages

Im trying to structure my app in Python. Coming back from C#/Java background, I like the approach of one class per file. Id like my project tree to look like this:[Service][Database]DbClass1.pyDbClass2…

PyMySQL Access Denied using password (no) but using password

Headscratcher here for me.I am attempting to connect to a database on my local MySQL 8.0.11.0 install from Python.Heres the code Im using :conn = pymysql.connect(host=localhost, port=3306, user=root, p…

Trouble importing Python modules on Ninja IDE

I have been trying to import modules into Ninja IDE for python. These are modules that I have working on the terminal (numpy, scipy, scitools, matplotlib, and mpl_toolkits), but will not run correctly …