Geopandas cannot be installed on M1
See original GitHub issue-
[Yes] I have read the documentation on installation and followed the instructions provided.
-
[Yes] I have looked through issues labeled “installation” in the geopandas repo.
-
If your issue is related to installation using the
conda-forge
channel, please open an issue in geopandas-feedstock repository instead.
System information
[what operating system do you have and what package management system are you using]
MacOS BigSur on Apple chip M1
Environment details
I followed the installation steps from Geopandas docs, but got an error on last step (see below):
(gds) frankjimenez@franks-mbp ~ % conda install python=3 geopandas Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: - Found conflicts! Looking for incompatible packages. This can take several minutes. Press CTRL-C to abort. failed
UnsatisfiableError: The following specifications were found to be incompatible with each other:
Output in format: Requested package -> Available versions
Package python conflicts for: geopandas -> pandas[version=‘>=0.23’] -> python[version=‘>=3.6|>=3.7|>=3.8,❤️.9.0a0|>=3.9,❤️.10.0a0’] geopandas -> python[version=‘>=3.5’] python=3 Note that strict channel priority may have removed packages required for satisfiability.
(gds) frankjimenez@franks-mbp ~ %
Issue Analytics
- State:
- Created 3 years ago
- Comments:25 (7 by maintainers)
I was having trouble running the above steps. What worked for me was to
brew install gdal proj
and then runpip install geopandas
Hope this may help someone later on.At the moment, installing geopandas on M1 macs is no longer an issue and can be achieved via conda or pip+homebrew. See the summary below. Keep in mind that a lot of comments from the thread above are no longer true.
GeoPandas itself is written in pure Python, so there is no issue running that on any architecture. However, it depends on other libraries that are written in other languages (C, C++) that need to be compiled specifically for M1 chips. While you could compile it yourself, I am not going to cover this option as it is not user friendly.
There are three possible sources of required libraries - pip wheels, conda-forge, and Homebrew.
When a Python package requires C dependency, it can create wheels with the dependency compiled for each system and chip architecture. See for example pygeos - https://pypi.org/project/pygeos/#files. What you need is
*macosx_11_0_arm64.whl
. If your package doesn’t offer it, you have to find another way of installing thanpip
. Since GeoPandas requires shapely and fiona (among others) that do not have these wheels, you should look elsewhere - either on conda-forge or Homebrew. Below are both options tested as of today.Conda and conda-forge way (recommended)
Conda-forge currently has all packages geopandas needs
Install M1 version of miniforge or mambaforge. It can be downloaded from here - https://github.com/conda-forge/miniforge.
Note: if you install x86 (Intel) version of conda, it will run under Rosetta2 and install all packages using x86 architecture, meaning that everything will run under emulation. Try to avoid that.
Pip and Homebrew way
Homebrew can install C libraries compiled for M1. Python packages will find and use them.
Using an environment with Python 3.9
Install shapely:
DYLD_LIBRARY_PATH
is needed for shapely to find GEOS installation.Install fiona:
Install pyproj:
Install geopandas and pygeos for speedups:
With all that, I am going to close the issue.