I'm writing a dockerized application in 2022 and wanted to avoid adding conda build dependencies (as it resulted in a very large container with long build time just to run a single package!). The most straight-forward answer I've found is adding the following packages to your requirements.txt
file:
numpy
pandas
shapely
fiona
six
cython
pyproj
geopandas
testing this in a container allowed me to remotely read a shapefile and print the first entry successfully
# python3 test.py
STATEFP 01
COUNTYFP 061
COUNTYNS 00161556
AFFGEOID 0500000US01061
GEOID 01061
NAME Geneva
NAMELSAD Geneva County
STUSPS AL
STATE_NAME Alabama
LSAD 06
ALAND 1487908432
AWATER 11567409
geometry POLYGON ((-86.19347599999999 31.192213, -86.12...
Name: 0, dtype: object
Letting it install just using the package names without a version gave me these package versions:
# pip3 freeze | egrep -i '(numpy|pandas|shapely|fiona|six|cython|pyproj|geopandas)'
Cython==0.29.26
Fiona==1.8.20
geopandas==0.10.2
numpy==1.22.1
pandas==1.3.5
pyproj==3.3.0
Shapely==1.8.0
six==1.16.0
Taking this approach reduced my build time to 44.2s
Source: geopandas github issue
Here's the size comparison between the conda container (gpd-test) for gpd vs the python container, since I mentioned it was a large container with a long build time.
$ docker image ls | egrep '(REPO|gpd)'
REPOSITORY TAG IMAGE ID CREATED SIZE
gpd-api latest 55b0022c6aaf 4 hours ago 386MB
gpd-test latest 5fc768d10a3a 4 weeks ago 3.2GB