Installation#
The recommended way to install pyrosm is from conda-forge with mamba (or its standalone variant micromamba), a fast drop-in replacement for conda. If you don’t have it yet, download and install mamba via Miniforge from the conda-forge download page — it ships mamba preconfigured with the conda-forge channel. Then install pyrosm with:
$ mamba install -c conda-forge pyrosm
or, with micromamba:
$ micromamba install -c conda-forge pyrosm
(the same command works with conda if you have it). You can also install the package with pip:
$ pip install pyrosm
Pyrosm supports Python 3.10–3.14.
Optional dependencies for graph export#
Exporting street networks to a graph (see Working with graphs) needs the backend you want to use installed:
$ pip install igraph networkx pandarm
Optional dependency for out-of-core reading#
The out-of-core engine (OSM(fp, engine="out_of_core")) caches each layer’s result to a GeoParquet file, which needs the optional pyarrow package:
$ pip install pyarrow
Without it the out-of-core reader still works, but returns an in-memory GeoDataFrame without caching.
Troubleshooting#
Pyrosm has a few dependencies (GeoPandas, Shapely, Cython, Protobuf and Cykhash) that need to be successfully installed before Pyrosm works. Most of these libraries are easy to install and Pyrosm handles them automatically when installing with pip. On Linux and Mac, pip installation should work out of the box.
However, on Windows, installing GeoPandas with pip can cause issues. Hence, it is recommended to install GeoPandas before installing pyrosm. See instructions from the GeoPandas website.