尝试安装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 32位)手动安装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,这是您所需要的,并且可以在您链接的站点上找到:
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文件?
More info here: https://pip.pypa.io/en/latest/user_guide/#installing-from-wheels and How do I install a Python package with a .whl file?
这篇关于尝试安装Fiona时,使用GDAL_CONFIG环境变量错误提供gdal-config的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!