Installation#
Install pyrosm with pip:
$ pip install pyrosm
pip installs prebuilt wheels of pyrosm and its dependencies, so nothing is compiled. Wheels are published for CPython 3.11–3.15 on glibc-based Linux (x86_64 and aarch64), macOS (Intel and Apple silicon) and Windows on x86_64.
You can also install pyrosm 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).
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, pyrosm’s default reader, 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.
Optional dependency for progress bars in Jupyter#
Downloads show a progress bar. In Jupyter it is drawn as a widget when ipywidgets is installed, which the notebook extra adds:
$ pip install "pyrosm[notebook]"
With conda, install ipywidgets from conda-forge. Without it, Jupyter shows a text bar instead.
Troubleshooting#
If pip starts building pyrosm from source, no wheel matches your platform or Python version, and the build needs a C compiler. On musl-based Linux such as Alpine, and on Windows on ARM, GeoPandas’ dependency pyogrio has no wheels either, and building it needs the GDAL library; in Docker, a Debian-based image such as python:3.12-slim gets wheels for everything. On the platforms conda-forge supports, which do not include musl-based Linux, installing from conda-forge avoids building from source.