尝试安装 Fiona 时,使用 GDAL_CONFIG 环境变量错误提供 gdal-config 的路径 [英] Provide a path to gdal-config using a GDAL_CONFIG environment variable error while attempting to install Fiona
问题描述
这是我收到的错误:
必须指定 GDAL API 版本.提供 gdal-config 的路径使用 GDAL_CONFIG 环境变量或使用 GDAL_VERSION环境变量.
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.
运行命令后:
pip install Fiona
从命令行.我必须从此处找到的轮文件(python 3.7 32bit)手动安装 GDAL:https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal
from the command line. I had to install GDAL manually from a wheel file found here (python 3.7 32bit): https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal
我已经为此寻找了解决方案,但建议的解决方案是通过 Conda 卸载并重新安装 GDAL,但我无法使用 Conda.
I have looked for a solution to this but the suggested solution is to uninstall and reinstall GDAL through Conda, and I am unable to use Conda.
如果有人能简单地告诉我 gdal-config
文件在哪里,那就太棒了,这样我就可以将它添加到我的环境变量中.也非常欢迎提供解决方案.
If anyone could tell me simply where the gdal-config
file is that would be fantastic so I can add it to my environment variables. A solution is also very welcome.
推荐答案
这不会显示 gdal-config 文件的位置,但可以解决您的 fiona 问题.
This doesn't show where the gdal-config file is, but solves your fiona issue.
首先下载相关的轮子文件(看起来像 Fiona‑1.8.4‑cp37‑cp37m‑win32.whl 是你想要的,它可以在你链接的站点上找到:https://www.lfd.uci.edu/~gohlke/pythonlibs/#fiona).
First download the relevant wheel file (looks like Fiona‑1.8.4‑cp37‑cp37m‑win32.whl is what you're after and it's available at the site you linked: https://www.lfd.uci.edu/~gohlke/pythonlibs/#fiona).
然后使用此命令(更改文件所在的路径):
Then use this command (changing the path to where you file is):
pip install C:/path/to/Fiona‑1.8.4‑cp37‑cp37m‑win32.whl
更多信息在这里:https://pip.pypa.io/en/latest/user_guide/#installing-from-wheels和 如何安装带有.whl 文件?
这篇关于尝试安装 Fiona 时,使用 GDAL_CONFIG 环境变量错误提供 gdal-config 的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!