我试过pip install geopandas
当我运行它时,我得到了这个错误:
Collecting geopandas
Using cached geopandas-0.8.1-py2.py3-none-any.whl (962 kB)
Collecting pyproj>=2.2.0
Using cached pyproj-2.6.1.post1-cp37-cp37m-win_amd64.whl (17.2 MB)
Requirement already satisfied: pandas>=0.23.0 in c:\users\ryans\anaconda3\lib\site-packages (from geopandas) (1.0.1)
Collecting fiona
Using cached Fiona-1.8.17.tar.gz (1.3 MB)
ERROR: Command errored out with exit status 1:
command: 'C:\Users\ryans\anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ryans\\AppData\\Local\\Temp\\pip-install-cw2z1439\\fiona\\setup.py'"'"'; __file__='"'"'C:\\Users\\ryans\\AppData\\Local\\Temp\\pip-install-cw2z1439\\fiona\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\ryans\AppData\Local\Temp\pip-install-cw2z1439\fiona\pip-egg-info'
cwd: C:\Users\ryans\AppData\Local\Temp\pip-install-cw2z1439\fiona\
Complete output (1 lines):
A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.我也尝试过conda install -c conda-forge geopandas
在本例中,一切都运行得很好,但是当我尝试运行这行代码时:
import geopandas as gpd我得到的结果是:
ModuleNotFoundError: No module named 'geopandas'我猜可能与已安装的其他库存在某种冲突,但这只是一种猜测,我不确定问题出在哪里。我怎么才能让这个东西工作呢?谢谢!!
发布于 2020-10-01 12:04:03
你可以试试
$ conda install -c anaconda pip
$ pip install geopandas
$ pip install Fiona发布于 2020-10-02 15:48:19
对我来说,这个安装是有效的(即使没有Anaconda)。从here (Gohlke)获取GDAL包
使用pip install GDAL_..._.whl安装它
安装时也会发生同样的错误,但没有问题!转到系统环境变量,创建一个新的系统变量,将其命名为GDAL_VERSION,并为其指定软件包版本的值。看起来像这样:

然后尝试再次安装GDAL,它将工作(也许您需要重新启动控制台)。然后用pip install geopandas安装geopandas,一切都会正常工作。
https://stackoverflow.com/questions/64147923
复制相似问题