简体   繁体   English

需要帮助在 Windows 10 中为 python 安装 fiona 和 geopandas - 无法加载请求的 DLL 错误

[英]Need help installing fiona and geopandas for python in Windows 10 - getting can't load requested DLL error

I am trying to install fiona and geopandas for python on Windows 10 and keep running into an error "ERROR 1: Can't load requested DLL".我正在尝试在 Windows 10 上为 python 安装 fiona 和 geopandas,但一直遇到错误“错误 1:无法加载请求的 DLL”。

I know this question is similar to other questions that have been asked, but I have followed the steps in multiple answers and tutorials and still can't seem to get this to work.我知道这个问题与其他问题类似,但我已经按照多个答案和教程中的步骤操作,但似乎仍然无法解决这个问题。

The closest I got was using the steps outlined in this tutorial : https://geoffboeing.com/2014/09/using-geopandas-windows/我得到的最接近的是使用本教程中概述的步骤: https : //geoffboeing.com/2014/09/using-geopandas-windows/

and are summarized as follows:总结如下:

  1. installed the .whl files for rtree, pyproj, shapely, gdal, geopandas, fiona from https://www.lfd.uci.edu/~gohlke/pythonlibs/https://www.lfd.uci.edu/~gohlke/pythonlibs/为 rtree、pyproj、shapely、gdal、geopandas、fiona 安装了 .whl 文件

    • Rtree-0.8.3-cp37-cp37m-win_amd64.whl Rtree-0.8.3-cp37-cp37m-win_amd64.whl
    • pyproj-2.2.1-cp37-cp37m-win_amd64.whl pyproj-2.2.1-cp37-cp37m-win_amd64.whl
    • GDAL-3.0.0-cp37-cp37m-win_amd64.whl GDAL-3.0.0-cp37-cp37m-win_amd64.whl
    • geopandas-0.5.0-py2.py3-none-any.whl geopandas-0.5.0-py2.py3-none-any.whl
    • Fiona-1.8.6-cp37-cp37m-win_amd64.whl Fiona-1.8.6-cp37-cp37m-win_amd64.whl
    • Shapely-1.6.4.post2-cp37-cp37m-win_amd64.whl Shapely-1.6.4.post2-cp37-cp37m-win_amd64.whl
  2. navigated to download folder and used pip install to install GDAL wheel导航到下载文件夹并使用 pip install 安装 GDAL wheel

  3. added the osgeo path to my windows user Path environment variable将 osgeo 路径添加到我的 Windows 用户路径环境变量中

环境变量屏幕

  1. used pip install to install remaining wheels (geopandas last), everything installed without errors使用 pip install 安装剩余的轮子(geopandas 最后),所有安装都没有错误
  2. As a check, I ran gdalinfo --help-general and get the following output:作为检查,我运行了gdalinfo --help-general并得到以下输出:

gdalinfo 输出

This is where I get the "ERROR 1: Can't load requested DLL:" error.这是我收到“错误 1:无法加载请求的 DLL:”错误的地方。 It says it cannot find the specified module "ogr_FileGDB.dll".它说它找不到指定的模块“ogr_FileGDB.dll”。 The weird thing is, that .dll is actually in the location that it is looking in???奇怪的是,.dll 实际上在它正在查找的位置???

dll位置

Also, in python shell, when trying to import fiona or geopandas I get the following errors:此外,在 python shell 中,当尝试导入 fiona 或 geopandas 时,我收到以下错误:

导入错误

This is beyond my level of troubleshooting...would really appreciate if anyone could get this thing working for me!!!!这超出了我的故障排除水平……如果有人能让这个东西为我工作,我将不胜感激!!!!

FYI - running Python 3.7.3, Windows 10, pip is updated.仅供参考 - 运行 Python 3.7.3、Windows 10、pip 已更新。

Lastly and potentially important (not sure how it plays in?) I already have a GDAL_DATA system variable defined, and also (maybe incorrectly?) also tried adding the osgeo path to my system path variable:最后,可能很重要(不确定它是如何发挥作用的?)我已经定义了一个 GDAL_DATA 系统变量,并且(可能不正确?)还尝试将 osgeo 路径添加到我的系统路径变量中:

系统环境变量

I was using a GDAL version that was not compatible with Fiona and subsequently causing issues with geopandas.我使用的 GDAL 版本与 Fiona 不兼容,随后导致 geopandas 出现问题。

I uninstalled GDAL 3 and installed GDAL 2.4.1 and it worked fine, as cgohlke suggested.正如 cgohlke 所建议的,我卸载了 GDAL 3 并安装了 GDAL 2.4.1,它运行良好。

pip install wheels
pip install pipwin

pipwin install numpy
pipwin install pandas
pipwin install shapely
pipwin install gdal
pipwin install fiona
pipwin install pyproj
pipwin install six
pipwin install rtree
pipwin install geopandas

here are the source links: http://geopandas.org/install.html#installation https://pip.pypa.io/en/latest/user_guide/#installing-from-wheels https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy 这是源链接: http ://geopandas.org/install.html#installation https://pip.pypa.io/en/latest/user_guide/#installing-from-wheels https://www.lfd.uci .edu /〜gohlke / pythonlibs /#numpy

If you still have problems, consider uninstalling the above (pip uninstall) and reinstalling. 如果仍然有问题,请考虑卸载以上内容(pip卸载)并重新安装。

Install fiona with conda , then that will solve the GDAL problem.使用conda安装fiona ,然后将解决GDAL问题。 pip install geopandas should work after that. pip install geopandas应该可以在此之后工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM