{"id":24008,"library":"maplibre","title":"MapLibre GL JS Python Bindings","description":"Python bindings for MapLibre GL JS, enabling interactive web maps with vector tiles, custom styling, and geospatial data visualization. Current version 0.3.6 with frequent updates. Supports Python 3.9+.","status":"active","version":"0.3.6","language":"python","source_language":"en","source_url":"https://github.com/maplibre/maplibre-gl-js","tags":["maps","geospatial","visualization","web-mapping","maplibre"],"install":[{"cmd":"pip install maplibre","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Direct class import is canonical; module attribute access may break in future.","wrong":"import maplibre; maplibre.MapLibre","symbol":"MapLibre","correct":"from maplibre import MapLibre"},{"note":"No class named MagicMap; use Map.","wrong":"from maplibre import MagicMap","symbol":"Map","correct":"from maplibre import Map"}],"quickstart":{"code":"from maplibre import MapLibre\nfrom maplibre.basemaps import Basemap\n\n# Create a MapLibre instance and display a map\nm = MapLibre()\nm.add_basemap(Basemap.CartoDB_Positron)\nm.show()","lang":"python","description":"Minimal example to display an interactive map with a basemap."},"warnings":[{"fix":"Use `from maplibre import MapLibre` instead of `Map`.","message":"The Map class was renamed to MapLibre in v0.2.0; old code using `from maplibre import Map` will raise ImportError.","severity":"breaking","affected_versions":"<0.2.0"},{"fix":"Ensure you call `m.show()` at the end of your code.","message":"Map does not automatically load in Jupyter notebooks without calling `m.show()` or using `%matplotlib notebook` magic. Without explicit display, the map appears as a blank output.","severity":"gotcha","affected_versions":"all"},{"fix":"Import and use `Basemap` from `maplibre.basemaps` instead of string literals.","message":"Basemap enumeration values may have changed between releases; hardcoding names like 'CartoDB_Positron' may break if the enum is renamed or removed. Always use the Basemap enum from `maplibre.basemaps`.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Replace `from maplibre import Map` with `from maplibre import MapLibre`.","cause":"Map class was renamed to MapLibre in v0.2.0.","error":"ImportError: cannot import name 'Map' from 'maplibre'"},{"fix":"Use `m.show()` or other methods; do not call the instance directly.","cause":"Instantiating MapLibre and then trying to call the instance as a function (e.g., `m = MapLibre(); m()`).","error":"TypeError: 'MapLibre' object is not callable"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}