Install & Compatibility
Where this runs
tested against v0.14 · 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
✓ 3.65s
py 3.11
✕ build_error
✓ 3.5s
py 3.12
✕ build_error
✕ build_error
py 3.13
✕ build_error
✕ build_error
py 3.9
✕ build_error
✓ 4.4s
99MB installed
● package 99MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating basic geometry objects (points, polygon) and performing a vectorized spatial operation (intersects).
import pygeos
# Create a single point
point_a = pygeos.points(0, 0)
# Create an array of points
points_array = pygeos.points([
[1, 1],
[2, 2],
[3, 3]
])
# Create a polygon
polygon = pygeos.polygons([(0, 0), (0, 4), (4, 4), (4, 0), (0, 0)])
# Perform a spatial operation: check intersection
intersects = pygeos.intersects(polygon, points_array)
print(f"Point A: {point_a}")
print(f"Points array: {points_array}")
print(f"Polygon: {polygon}")
print(f"Intersects with polygon: {intersects}") # Expected: [True, True, True]
Debug
Known issues
breakingPyGEOS is officially deprecated as its core functionality has been merged into Shapely 2.0+. No new major features or releases are expected. New projects should use Shapely 2.x, and existing projects should plan to migrate.fixFor new projects, use `shapely` (install `pip install shapely`). For existing projects, refer to the Shapely 2.0 migration guide for `pygeos` users (e.g., `shapely.from_pygeos()`, `shapely.to_pygeos()`).
affects: All versions, especially relevant since Shapely 2.0+
gotchaPyGEOS requires the GEOS C library (>= 3.5.0, preferably >= 3.6.0 for full features) to be installed on your system. `pip install pygeos` only installs the Python bindings, not the underlying C library. Failure to install GEOS will result in runtime errors.fixInstall GEOS via your system's package manager (e.g., `sudo apt-get install libgeos-dev` on Ubuntu, `brew install geos` on macOS) or through a package manager like Conda (`conda install -c conda-forge pygeos`).
affects: All versions
gotchaPyGEOS objects are distinct from Shapely 1.x objects. Direct interoperation between them without explicit conversion methods (e.g., `pygeos.from_shapely`, `shapely.to_pygeos`) can lead to `TypeError` or unexpected behavior.fixConvert geometries between the libraries using `pygeos.from_shapely()` or `shapely.to_pygeos()` when necessary. For a unified approach, migrate to Shapely 2.x, which uses the same internal geometry representation.
affects: All versions when interoperating with Shapely < 2.0
gotchaOptimal performance in PyGEOS is achieved by leveraging its vectorized ufuncs, which expect NumPy arrays of geometries or coordinates as input. Iterating over scalar PyGEOS geometries in Python loops negates much of the performance benefit.fixAlways pass NumPy arrays of geometries or coordinate arrays directly to `pygeos` functions for best performance. For example, `pygeos.area(geometry_array)` instead of `[pygeos.area(g) for g in geometry_list]`.
affects: All versions
Upgrade
Version history
0.14latest on PyPI · released Dec 12, 2022
Audit
Dependencies
numpyrequiredCore dependency for vectorized operations and ufuncs.
geosrequiredRequired GEOS C library (>= 3.5.0) for core geometry operations. Not a Python package, needs system installation.