Windows10+python3.10 安装geopandas库时,所依赖的fiona库安装失败!

python安装geopandas、fiona包出错:Provide a path to gdal-config using a GDAL_CONFIG environment

下面是报错的代码:

Collecting fiona>=1.8

  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/67/5c/4e028e84a1f0cb3f8a994217cf2366360ca984dfc1433f6171de527d0dca/Fiona-1.8.21.tar.gz (1.0 MB)

  Preparing metadata (setup.py) ... error

  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.

  │ exit code: 1

  ╰─> [1 lines of output]

      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.

      [end of output]


  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed


× Encountered error while generating package metadata.

╰─> See above for output.


note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

解决办法

1. 下载所需要的whl文件

在网站https://www.lfd.uci.edu/~gohlke/pythonlibs/ 上下载适合自己电脑版本的fiona库的whl文件,我下载了Fiona-8.21-cp310-cp310-win_amd64.whl

2. pip安装

打开windows powershell(管理员)(A)【右键点击屏幕左下角的windows标志,进行选择】,先切换到whl的下载路径(我的是默认了C盘的路径),再pip指令安装即可。

 黄色标注部分即输入的部分

PS C:\WINDOWS\system32> cd C:\Users\Administrator\Downloads

PS C:\Users\Administrator\Downloads> pip install Fiona-1.8.21-cp310-cp310-win_amd64.whl

3. 安装geopandas库

切回cmd,切换到python3.10的目录,执行以下命令:

pip install geopandas -i https://pypi.douban.com/simple/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值