question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Geopandas cannot be installed on M1

See original GitHub issue

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:closed
  • Created 3 years ago
  • Comments:25 (7 by maintainers)

github_iconTop GitHub Comments

22reactions
LiamBuicommented, Sep 1, 2021

I was having trouble running the above steps. What worked for me was to brew install gdal proj and then run pip install geopandas Hope this may help someone later on.

20reactions
martinfleiscommented, Dec 30, 2021

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 than pip. 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.

conda install -c conda-forge geopandas pygeos

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:

brew install geos
export DYLD_LIBRARY_PATH=/opt/homebrew/opt/geos/lib/
pip install shapely

DYLD_LIBRARY_PATH is needed for shapely to find GEOS installation.

Install fiona:

brew install gdal
pip install fiona

Install pyproj:

brew install proj
pip install pyproj

Install geopandas and pygeos for speedups:

pip install pygeos
pip install geopandas

With all that, I am going to close the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error installing geopandas in python on mac m1
I'm trying to install geopandas on my M1 mac and I'm running into errors. I tried to pip install all the dependencies individually...
Read more >
Installation — GeoPandas 0.12.2+0.gefcb367.dirty ...
To install GeoPandas and all its dependencies, we recommend to use the conda package manager. This can be obtained by installing the Anaconda...
Read more >
Installing GeoPandas on Apple M1? - GIS Stack Exchange
I have the new Macbook Pro M1 with BigSur. I have installed miniforge via new Homebrew (compatible for M1 chips). Then I created...
Read more >
Martin Fleischmann on Twitter: "If you ever had troubles ...
Geopandas cannot be installed on M1 · Issue #1816 · geopandas/geopandas. [Yes] I have read the documentation on installation and followed ...
Read more >
How to Install Geopandas on MacOS? - GeeksforGeeks
GeoPandas is a project to add support for geographic data to pandas objects. Installation: Method 1: Using pip to install GeoPandas. Follow the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found