Install & Compatibility
Where this runs
tested against v0.0.8 · 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
py 3.10
✕ build_error
✓ 13.3s
py 3.11
✕ build_error
✓ 12.6s
py 3.12
✕ build_error
✓ 12.9s
py 3.13
✕ build_error
✕ build_error
py 3.9
✕ build_error
✓ 9.1s
407MB installed
● package 407MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
turfpy
✓ import turfpy
✗ from turfpy import ...
Common pattern: import turfpy and call turfpy.function().
measurement
✓ from turfpy import measurement
✗ import measurement
measurement is a submodule, not top-level.
Calculate distance between two points using turfpy.
import turfpy
from turfpy import measurement
from geojson import Point, Feature
point1 = Feature(geometry=Point((-3.0, 53.0)))
point2 = Feature(geometry=Point((-2.0, 55.0)))
distance = measurement.distance(point1, point2)
print(f'Distance: {distance}')
Errors
Common errors & fixes
AttributeError: module 'turfpy' has no attribute 'distance'
distance is in turfpy.measurement submodule, not top-level.
fixUse from turfpy import measurement; measurement.distance(...)
TypeError: Object of type Polygon is not JSON serializable
turfpy expects GeoJSON Feature or geometry dict, not raw shapely object.
fixConvert to GeoJSON: from geojson import Feature; Feature(geometry=your_shapely_polygon)
ModuleNotFoundError: No module named 'turfpy'
turfpy not installed or installed in wrong environment.
fixRun 'pip install turfpy' or check that you're in the correct Python environment.
Upgrade
Version history
0.0.8latest on PyPI · released Nov 11, 2024
Audit
Dependencies
geopandasrequiredused for spatial operations
shapelyrequiredgeometry backend
numpyrequirednumerical operations