windows下用pip 安装geopandas

pip 安装geopandas与conda相比较复杂,需要先安装依赖包,才能进行正式安装

**1.pip install geopandas**


报错:缺少fiona

Collecting geopandas
  Using cached geopandas-0.8.1-py2.py3-none-any.whl (962 kB)
Collecting fiona
  Using cached Fiona-1.8.17.tar.gz (1.3 MB)
    ERROR: Command errored out with exit status 1:
     command: 'C:\ProgramData\Miniconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\grfood126\\AppData\\Local\\Temp\\pip-insta
ll-u25cimx0\\fiona\\setup.py'"'"'; __file__='"'"'C:\\Users\\grfood126\\AppData\\Local\\Temp\\pip-install-u25cimx0\\fiona\\setup.py'"'"';f=getattr(tokenize, '"'"'op
en'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users
\grfood126\AppData\Local\Temp\pip-install-u25cimx0\fiona\pip-egg-info'
         cwd: C:\Users\grfood126\AppData\Local\Temp\pip-install-u25cimx0\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.

**2.geopandas的依赖包**)

numpy
pandas (version 0.23.4 or later)
shapely (interface to GEOS)
fiona (interface to GDAL)

pyproj (interface to PROJ; version 2.2.0 or later)
pip install numpy
pip install pandas
pip install shapely
**pip install pyproj **

**3.安装Fiona**)

下载https://www.lfd.uci.edu/~gohlke/pythonlibs/#fiona
注意版本与python版本一致
在这里插入图片描述
刚开始没注意版本,报错。发现下载的版本不对

pip install Fiona-1.8.17-cp39-cp39-win_amd64.whl
ERROR: Fiona-1.8.17-cp39-cp39-win_amd64.whl is not a supported wheel on this platform.
pip install Fiona-1.8.17-cp38-cp38-win_amd64.whl

报错:需要先安装gdal

Building wheels for collected packages: gdal
  Building wheel for gdal (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\ProgramData\Miniconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\grfood126\\AppData\\Local\\Temp\\pip-install-k7ggrok8\\gdal\\setup.py'"'"'; __file__='"'"'C:\\Users\\grfood126\\AppData\\Local\\Temp\\pip-install-k7ggrok8\\gdal\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\grfood126\AppData\Local\Temp\pip-wheel-_c9puvxf'

**4.安装GDAL**)

pip install GDAL-3.1.4-cp38-cp38-win_amd64.whl

再重新安装gdal,成功

pip install Fiona-1.8.17-cp38-cp38-win_amd64.whl

在这里插入图片描述

**5.pip install geopandas**) 成功


成功

已经安装后,仍然报错,找不到pandas模块。怀疑pip版本不对,查看后发现python3.8对应了两个pip版本,pycharm设置的python是第二个。所以用pip3重新安装一遍上面的依赖及geopandas

F:\python\gis>pip -V
pip 20.0.2 from C:\ProgramData\Miniconda3\lib\site-packages\pip (python 3.8)

F:\python\gis>pip3 -V
pip 20.2.4 from d:\program files (x86)\python3\lib\site-packages\pip (python 3.8)
  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

yuan86_12

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值