Install & Compatibility
Where this runs
tested against v0.5.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.702s · 40.5MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.8s · import 0.610s · 41MB
39MB installed
● package 39MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
StaticMap
✓ from staticmap import StaticMap
Correct import path
CircleMarker
✓ from staticmap import CircleMarker
Line
✓ from staticmap import Line
Creates a map with a marker and a line, saved to map.png.
from staticmap import StaticMap, CircleMarker, Line
m = StaticMap(600, 400, url_template='https://tile.openstreetmap.org/{z}/{x}/{y}.png')
marker = CircleMarker((13.405, 52.52), 'blue', 12)
m.add_marker(marker)
line = Line([(13.4, 52.5), (13.41, 52.53)], 'red', 2)
m.add_line(line)
image = m.render()
image.save('map.png')
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'staticmap'
Library not installed or installed in wrong environment.
fixRun: pip install staticmap
TypeError: argument of type 'NoneType' is not iterable
Tile URL template is not set or tiles cannot be fetched.
fixSpecify a valid url_template: m = StaticMap(600, 400, url_template='https://tile.openstreetmap.org/{z}/{x}/{y}.png') Upgrade
Version history
0.5.7latest on PyPI · released Aug 1, 2023
Audit
Dependencies
PillowrequiredImage manipulation backend
requestsrequiredDownloading map tiles