yo so im trying to do a mobile application using python this is my code: import kivy
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.garden.folium import MapView, Marker
import folium
class MapScreen(BoxLayout):
def __init__(self, **kwargs):
super().__init__(**kwargs)
# Create a Folium map
m = folium.Map(location=[51.5074, -0.1278], zoom_start=13)
# Add a marker to the map
marker = folium.Marker(location=[51.5074, -0.1278], popup='London')
marker.add_to(m)
# Convert the Folium map to a Kivy widget
self.mapview = MapView(zoom=13, lat=51.5074, lon=-0.1278)
self.mapview.add_tile_layer('http://{s}.tile.osm.org/{z}/{x}/{y}.png')
self.mapview.add_marker(Marker(lat=51.5074, lon=-0.1278, popup='London'))
# Add the Kivy widget to the screen
self.add_widget(self.mapview)
class MapApp(App):
def build(self):
return MapScreen()
if __name__ == '__main__':
MapApp().run()
but i get this result:
Traceback (most recent call last):
File "C:\Users\nikor\Desktop\map_app.py", line 4, in <module>
from kivy.garden.folium import MapView, Marker
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 672, in _load_unlocked
File "<frozen importlib._bootstrap>", line 640, in _load_backward_compatible
KeyError: 'kivy.garden.folium' Traceback (most recent call last):
File "C:\Users\nikor\Desktop\map_app.py", line 4, in <module>
from kivy.garden.folium import MapView, Marker
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 672, in _load_unlocked
File "<frozen importlib._bootstrap>", line 640, in _load_backward_compatible
KeyError: 'kivy.garden.folium'
any ideas ?
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.garden.folium import MapView, Marker
import folium
class MapScreen(BoxLayout):
def __init__(self, **kwargs):
super().__init__(**kwargs)
# Create a Folium map
m = folium.Map(location=[51.5074, -0.1278], zoom_start=13)
# Add a marker to the map
marker = folium.Marker(location=[51.5074, -0.1278], popup='London')
marker.add_to(m)
# Convert the Folium map to a Kivy widget
self.mapview = MapView(zoom=13, lat=51.5074, lon=-0.1278)
self.mapview.add_tile_layer('http://{s}.tile.osm.org/{z}/{x}/{y}.png')
self.mapview.add_marker(Marker(lat=51.5074, lon=-0.1278, popup='London'))
# Add the Kivy widget to the screen
self.add_widget(self.mapview)
class MapApp(App):
def build(self):
return MapScreen()
if __name__ == '__main__':
MapApp().run()
but i get this result:
Traceback (most recent call last):
File "C:\Users\nikor\Desktop\map_app.py", line 4, in <module>
from kivy.garden.folium import MapView, Marker
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 672, in _load_unlocked
File "<frozen importlib._bootstrap>", line 640, in _load_backward_compatible
KeyError: 'kivy.garden.folium' Traceback (most recent call last):
File "C:\Users\nikor\Desktop\map_app.py", line 4, in <module>
from kivy.garden.folium import MapView, Marker
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 672, in _load_unlocked
File "<frozen importlib._bootstrap>", line 640, in _load_backward_compatible
KeyError: 'kivy.garden.folium'
any ideas ?