{"id":22493,"library":"types-geopandas","title":"types-geopandas","description":"PEP 561 typing stubs for geopandas, provided by typeshed. Version 1.1.3.20260408 supports Python >=3.10. These stubs allow static type checkers like mypy and pyright to understand geopandas types. They are released on a rolling schedule, synced to geopandas releases.","status":"active","version":"1.1.3.20260408","language":"python","source_language":"en","source_url":"https://github.com/python/typeshed","tags":["typing","stubs","geopandas","typeshed","mypy","pyright"],"install":[{"cmd":"pip install types-geopandas","lang":"bash","label":"Install stubs from PyPI"}],"dependencies":[],"imports":[{"note":"geopandas itself exports GeoDataFrame from the top-level package; stub mirrors that","wrong":"from geopandas.geodataframe import GeoDataFrame","symbol":"GeoDataFrame","correct":"from geopandas import GeoDataFrame"},{"note":"Same as GeoDataFrame; always import from top-level geopandas","wrong":"from geopandas.geoseries import GeoSeries","symbol":"GeoSeries","correct":"from geopandas import GeoSeries"},{"note":"read_file is a top-level function in geopandas","wrong":"from geopandas.io.file import read_file","symbol":"read_file","correct":"from geopandas import read_file"}],"quickstart":{"code":"import geopandas as gpd\n\n# Ensure stubs are installed (types-geopandas) so mypy can check\n# Example: create a GeoDataFrame from a file\n# Replace 'filepath' with a real path or use built-in example\n# df: gpd.GeoDataFrame = gpd.read_file('filepath')\n\n# Example with world dataset (requires geopandas.datasets)\ndf = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))\nprint(type(df))  # mypy will infer GeoDataFrame thanks to stubs","lang":"python","description":"Basic usage: import geopandas, use read_file to get a GeoDataFrame with type hints."},"warnings":[{"fix":"Ensure both are installed: pip install geopandas types-geopandas","message":"types-geopandas is not the same as geopandas itself. You must install geopandas separately (pip install geopandas). Many users mistakenly think installing types-geopandas provides geopandas functionality.","severity":"gotcha","affected_versions":"all"},{"fix":"Use shapely.geometry.Point (or other) as the underlying geometry type. For example: from shapely.geometry import Point","message":"Older versions of geopandas used shapely.geometry types directly. In geopandas >=0.12, they moved to using shapely 2.0 Geometry types. The stubs reflect this, so code expecting old type names may break.","severity":"deprecated","affected_versions":"types-geopandas >=0.12"},{"fix":"Upgrade: pip install --upgrade types-geopandas","message":"The stubs are auto-generated and may lag behind geopandas releases. If you encounter type errors that seem incorrect, check if a newer types-geopandas version is available. If not, you may need to add inline # type: ignore comments.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run: pip install geopandas","cause":"Installation of types-geopandas only installs stubs, not geopandas itself.","error":"ModuleNotFoundError: No module named 'geopandas'"},{"fix":"Use: from geopandas import GeoDataFrame","cause":"User imported from an internal module instead of top-level geopandas.","error":"error: Name 'GeoDataFrame' is not defined"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}