安装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没配置好
- 下载GDAL:
cp代表python版本,cp39就是python3.9,我是3.9
2. 安装GDAL
pip install GDAL-3.4.3-cp39-cp39-win_amd64.whl
- 设置变量
我的python项目路径是:D:\code_management\pythonProject,需要自己修改
set GDAL_DATA=%GDAL_DATA%;D:\code_management\pythonProject\venv\Lib\site-packages\osgeo\data\gdal
-
下载Fiona文件
链接 -
安装Fiona
pip install Fiona-1.8.21-cp39-cp39-win_amd64.whl
- 安装deepforest
pip install deepforest