当前位置:   article > 正文

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

fiona库

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

下面是报错的代码:

  1. Collecting fiona>=1.8
  2. Using cached https://pypi.tuna.tsinghua.edu.cn/packages/67/5c/4e028e84a1f0cb3f8a994217cf2366360ca984dfc1433f6171de527d0dca/Fiona-1.8.21.tar.gz (1.0 MB)
  3.   Preparing metadata (setup.py) ... error
  4.   error: subprocess-exited-with-error
  5.   × python setup.py egg_info did not run successfully.
  6.   │ exit code: 1
  7.   ╰─> [1 lines of output]
  8.       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.
  9.       [end of output]
  10.   note: This error originates from a subprocess, and is likely not a problem with pip.
  11. error: metadata-generation-failed
  12. × Encountered error while generating package metadata.
  13. ╰─> See above for output.
  14. note: This is an issue with the package mentioned above, not pip.
  15. 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/

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/71174
推荐阅读
相关标签
  

闽ICP备14008679号