ModuleNotFoundError: No module named 'geopandas' on Mac M3 chip

Hey yall, I’m so lost. Everything works locally but when deploying geopandas won’t install even though I’ve installed it.

I’ve tried it with a requirements.txt instead of environment.yml but I’m on a newer Mac with an M3 chip so I’m using Conda to better handle dependencies. I am fairly new to all this so appreciate any guidance around this topic and other tips on how to deal with the issues new macs run into in this realm.

TYIA!

  1. Link to the public app (deployed on Community Cloud): https://usa-health-disparity.streamlit.app/
  2. GitHub repository: Predicting-Health-Disparity/environment.yml at main · erankova/Predicting-Health-Disparity · GitHub
  3. Full text of the error message:
ModuleNotFoundError: No module named 'geopandas'
────────────────────── Traceback (most recent call last) ───────────────────────  
/home/adminuser/.conda/lib/python3.11/site-packages/streamlit/runtime/script  runner/script_runner.py:600 in _run_script  

/mount/src/predicting-health-disparity/src/deployment.py:5 in <module>      
2 import pickle      
3 import pandas as pd      
4 import json 
❱ 5 import geopandas as gpd      
6 from shapely import wkt      
7 import numpy as np      
8 import random
  1. Streamlit and Python versions: Streamlit, version 1.34.0, Python 3.12.3

Search the logs for messages related to the installation of geopandas.

So the issue is that its not being installed during deployment. I need to understand why and how to fix this. Everything works locally and geopandas is in the yml file linked in the post. Not sure what’s going on but probably something with pyarrow given from the research i’ve done. I just don’t know a streamlined way to fix it so I need help.

1 Like

I’m getting the same issue with geopandas not loading when deployed to Streamlit Cloud

Update: I got the app to deploy by including a requirements.txt file in my github repo that included geopandas

Yes, same here. What worked for me is redoing my entire environment with pip vs anaconda and including a requirements.txt vs yml.