栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

A GDAL API version must be specified. Provide a path to gdal-config using a GDAL

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

A GDAL API version must be specified. Provide a path to gdal-config using a GDAL

安装deepforest深度森林算法库报错:

pi install deepforest

错误提示:

Collecting fiona>=1.8
  Using cached 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.

安装geopandas库时会自动安装Fiona库,实际上这个错误是安装Fiona时报的,大概原因是GDAL没配置好

  1. 下载GDAL:

链接

cp代表python版本,cp39就是python3.9,我是3.9

2. 安装GDAL

pip install GDAL-3.4.3-cp39-cp39-win_amd64.whl
  1. 设置变量

我的python项目路径是:D:code_managementpythonProject,需要自己修改

set GDAL_DATA=%GDAL_DATA%;D:code_managementpythonProjectvenvLibsite-packagesosgeodatagdal
  1. 下载Fiona文件
    链接

  2. 安装Fiona

pip install Fiona-1.8.21-cp39-cp39-win_amd64.whl
  1. 安装deepforest
pip install deepforest
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/1029301.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号