[英]Installation fails for Fiona and Geopandas with GDAL on Python 3.6 on Microsoft Windows OS?
I need to install Geopandas which depends on Fiona and GDAL with pip on Python 3.6.我需要在 Python 3.6 上使用 pip 安装依赖于 Fiona 和 GDAL 的 Geopandas。 I have installed the GDAL library on Python using the wheel file downloaded from here .
我已经使用从这里下载的轮文件在 Python 上安装了 GDAL 库。
Processing c:\users\_chena\downloads\gdal-2.4.1-cp36-cp36m-win_amd64.whl
Installing collected packages: GDAL
Successfully installed GDAL-2.4.1
Then I tried to pip3 install geopandas
.然后我尝试
pip3 install geopandas
。 I encountered the following error:我遇到了以下错误:
Collecting geopandas
Downloading https://files.pythonhosted.org/packages/f0/5d/916b7268ef551fa9647c
e12220e9a68006374f1ce5b0ddaf1cd0df2880b7/geopandas-0.4.1-py2.py3-none-any.whl (9
22kB)
100% |████████████████████████████████| 931kB 4.1MB/s
Requirement already satisfied: pandas in d:\aaa_workspace\alex\supportsarah\hist
oricalplanburnwindowsproject\venv\lib\site-packages (from geopandas) (0.24.1)
Requirement already satisfied: shapely in d:\aaa_workspace\alex\supportsarah\his
toricalplanburnwindowsproject\venv\lib\site-packages (from geopandas) (1.6.4.pos
t1)
Collecting fiona (from geopandas)
Downloading https://files.pythonhosted.org/packages/41/9d/63696e7b1de42aad294d
4781199a408bec593d8fdb80a2b4a788c911a33b/Fiona-1.8.6.tar.gz (1.7MB)
100% |████████████████████████████████| 1.7MB 7.9MB/s
Complete output from command python setup.py egg_info:
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.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\_chena\A
ppData\Local\Temp\2\pip-install-vy05tre2\fiona\
I can't find anywhere that the gdal-data directory is located.我找不到 gdal-data 目录所在的任何地方。 Given the error log as such
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.
鉴于错误日志,
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.
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.
, how can I go about setting the GDAL_CONFIG environment variable with the Python GDAL library installed through pip3? ,如何使用通过 pip3 安装的 Python GDAL 库设置 GDAL_CONFIG 环境变量?
The only solution seems to be installing the ready binaries from here ~gohlke
唯一的解决方案似乎是从这里安装准备好的二进制文件
~gohlke
https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal
Then, just install the required libraries locally.然后,只需在本地安装所需的库。 For me, I did the following in this order (Python
3.8.6
)对我来说,我按这个顺序做了以下(Python
3.8.6
)
pip install GDAL-3.1.4-cp38-cp38-win_amd64.whl
pip install Fiona-1.8.18-cp38-cp38-win_amd64.whl
pip install geopandas-0.8.1-py3-none-any.whl
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.