{"id":7342,"library":"kivy-garden","title":"Kivy Garden","description":"Kivy Garden is a project and command-line tool that centralizes user-contributed add-ons, called \"flowers,\" for the Kivy framework. These \"flowers\" are typically distributed as separate PyPI packages under the `kivy_garden.*` namespace (e.g., `kivy_garden.mapview`). The `kivy-garden` tool facilitates the management and installation of both legacy and modern pip-installable Kivy extensions. It is currently at version 0.1.5 and provides utilities for Kivy developers to extend their applications with community-contributed widgets and tools.","status":"active","version":"0.1.5","language":"en","source_language":"en","source_url":"https://github.com/kivy-garden","tags":["Kivy","GUI","Widgets","Addons","Mobile Development","Python"],"install":[{"cmd":"pip install kivy-garden","lang":"bash","label":"Install the Kivy Garden management tool"},{"cmd":"pip install kivy_garden.mapview","lang":"bash","label":"Install a modern Kivy Garden 'flower' (e.g., MapView)"},{"cmd":"garden install graph","lang":"bash","label":"Install a legacy Kivy Garden 'flower' using the `garden` command"}],"dependencies":[{"reason":"Kivy Garden provides extensions for the Kivy framework. Kivy is a mandatory dependency for using any Kivy Garden 'flower'.","package":"kivy"}],"imports":[{"note":"Modern Kivy Garden 'flowers' are separate Python packages imported directly from the `kivy_garden` namespace. The `kivy.garden` path was for older, legacy integrations.","wrong":"from kivy.garden import mapview","symbol":"MapView","correct":"from kivy_garden.mapview import MapView"}],"quickstart":{"code":"from kivy.app import App\nfrom kivy.uix.boxlayout import BoxLayout\nfrom kivy_garden.mapview import MapView, MapMarker\nfrom kivy.core.window import Window\n\n# Ensure kivy_garden.mapview is installed: pip install kivy_garden.mapview\n\nclass MapApp(App):\n    def build(self):\n        Window.size = (800, 600)\n        box = BoxLayout(orientation='vertical')\n        # Initialize MapView with example coordinates\n        mapview = MapView(zoom=11, lat=50.6394, lon=3.057)\n        # Add a marker to the map\n        marker = MapMarker(lat=50.6394, lon=3.057, source=\"atlas://kivy_atlas/data/images/defaulttheme/star\")\n        mapview.add_marker(marker)\n        box.add_widget(mapview)\n        return box\n\nif __name__ == '__main__':\n    MapApp().run()","lang":"python","description":"This quickstart demonstrates how to create a simple Kivy application displaying an interactive map using the `kivy_garden.mapview` 'flower'. It initializes a MapView widget and places a marker on it, showcasing the standard import and usage pattern for modern Kivy Garden components."},"warnings":[{"fix":"For new projects, prioritize `pip install kivy_garden.flower_name` and `from kivy_garden.flower_name import ...`. For existing legacy projects, ensure `kivy-garden` is installed and use the `garden` command or migrate flowers to the new format if possible.","message":"Kivy 1.11.0 introduced a significant shift in the Kivy Garden structure. Newer 'flowers' are designed to be installed via `pip install kivy_garden.flower_name` and imported from `kivy_garden.*`. While the legacy `garden install flower_name` command still functions for older modules, new development and support primarily target the pip-installable package format.","severity":"breaking","affected_versions":"Kivy >= 1.11.0, kivy-garden >= 0.1.0"},{"fix":"Always check the specific 'flower's' GitHub repository or documentation for its status, last update, and compatibility. Use at your own risk and consider contributing or forking if a critical 'flower' becomes unmaintained.","message":"Kivy Garden 'flowers' are community-contributed and are not actively monitored or officially supported by the core Kivy developers. Their stability, maintenance, and adherence to Kivy's latest versions can vary significantly between individual 'flowers'.","severity":"gotcha","affected_versions":"All versions"},{"fix":"In `buildozer.spec`, add `kivy_garden.flower_name` to the `requirements` list (e.g., `requirements = python3,kivy,kivy_garden.mapview`). Alternatively, for legacy flowers, use `garden install --app flower_name` from your app directory.","message":"When packaging Kivy applications for mobile platforms (e.g., Android with Buildozer) that use Kivy Garden 'flowers', merely installing `kivy-garden` is insufficient. Each specific `kivy_garden.flower_name` package must be explicitly listed in the `requirements` section of your `buildozer.spec` file, or installed using `garden install --app flower_name` during the build process, to ensure it's bundled with your application.","severity":"gotcha","affected_versions":"All versions when packaging for mobile"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Explicitly add `kivy_garden.mapview` (or the name of your flower) to the `requirements` list in your `buildozer.spec` file. For example: `requirements = python3,kivy,kivy_garden.mapview`.","cause":"The Kivy Garden 'flower' was not correctly included in the Android application package (APK), even if it runs fine on desktop. Buildozer did not detect or bundle the `kivy_garden.*` module.","error":"KeyError: 'kivy.garden.mapview' (or similar for other flowers) in Android build logs"},{"fix":"Ensure the specific 'flower' is installed (e.g., `pip install kivy_garden.graph` or `garden install graph`). If it's a modern flower, use the import `from kivy_garden.graph import Graph`. If it's a legacy flower managed by the `garden` tool, ensure `kivy-garden` is installed and the `garden` command was used.","cause":"You are trying to import a Kivy Garden 'flower' using an outdated or incorrect import path, or the flower itself is not installed.","error":"ModuleNotFoundError: No module named 'kivy.garden.graph' (or similar for other flowers)"}]}