简体   繁体   English

OSError: 无法找到或加载 spatialindex_c.dll

[英]OSError: could not find or load spatialindex_c.dll

I have installed the whl files for fiona, shapely, gdal, rtree and pyproj.我已经为 fiona、shapely、gdal、rtree 和 pyproj 安装了 whl 文件。 Geopandas is also installed via pip install. Geopandas 也是通过 pip install 安装的。 But I get the following error when importing it:但是导入时出现以下错误:

import geopandas
Traceback (most recent call last):

  File "<ipython-input-14-c9ee6bd24dbc>", line 1, in <module>
    import geopandas

  File "C:\ProgramData\Anaconda3\lib\site-packages\geopandas\__init__.py", line 1, in <module>
    from geopandas.geoseries import GeoSeries

  File "C:\ProgramData\Anaconda3\lib\site-packages\geopandas\geoseries.py", line 12, in <module>
    from geopandas.base import GeoPandasBase, _series_unary_op, _CoordinateIndexer

  File "C:\ProgramData\Anaconda3\lib\site-packages\geopandas\base.py", line 14, in <module>
    from rtree.core import RTreeError

  File "C:\ProgramData\Anaconda3\lib\site-packages\rtree\__init__.py", line 1, in <module>
    from .index import Rtree

  File "C:\ProgramData\Anaconda3\lib\site-packages\rtree\index.py", line 5, in <module>
    from . import core

  File "C:\ProgramData\Anaconda3\lib\site-packages\rtree\core.py", line 116, in <module>
    raise OSError("could not find or load spatialindex_c.dll")

OSError: could not find or load spatialindex_c.dll

and the following error as well:以及以下错误:

import fiona
Traceback (most recent call last):

  File "<ipython-input-16-cc872b235141>", line 1, in <module>
    import fiona

  File "C:\ProgramData\Anaconda3\lib\site-packages\fiona\__init__.py", line 77, in <module>
    from fiona.collection import Collection, BytesCollection, vsi_path

  File "C:\ProgramData\Anaconda3\lib\site-packages\fiona\collection.py", line 9, in <module>
    from fiona.ogrext import Iterator, ItemsIterator, KeysIterator

  File "fiona\ogrext.pyx", line 25, in init fiona.ogrext

ImportError: cannot import name compat

Can somebody please help me here?有人可以帮我吗? I'm not being able to figure out how to fix this issue.我无法弄清楚如何解决这个问题。 Thanks and regards.感谢致敬。

You could try the installation with conda instead of pip.您可以尝试使用 conda 而不是 pip 进行安装。

conda install -c conda-forge cenpy

See the CenPy documentation: https://pypi.org/project/cenpy/请参阅 CenPy 文档: https ://pypi.org/project/cenpy/

You don't need to separately install geopandas and Rtree if you use conda.如果使用 conda,则无需单独安装 geopandas 和 Rtree。

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

相关问题 在 Windows 中“找不到或加载空间索引_c.dll”? - " could not find or load spatialindex_c.dll" in windows? OSError:找不到 geos_c.dll 或加载其任何变体 - OSError: Could not find geos_c.dll or load any of its variants 匀称的 OSError:找不到 lib c 或加载其任何变体 [] - Shapely OSError: Could not find lib c or load any of its variants [] 导入 geopandas 时出错 OSError: 找不到 lib c 或加载其任何变体 [] - Error when importing geopandas OSError: Could not find lib c or load any of its variants [] OSError:无法加载共享对象文件:llvmlite.dll(SHAP 相关。可能缺少什么?) - OSError: Could not load shared object file: llvmlite.dll (SHAP related. What could be missing?) python3.8加载dll OSError: [WinError 127] 找不到指定的程序 - python3.8 load dll OSError: [WinError 127] The specified procedure could not be found 无法在python中加载c ++ DLL - could not load c++ DLL in python OSError:找不到 kaggle.json。 确保它位于 C:\Users\Lior\.kaggle 中。 或者使用环境方法 - OSError: Could not find kaggle.json. Make sure it's located in C:\Users\Lior\.kaggle. Or use the environment method OSError:找不到合适的 TLS CA 证书包 - OSError: Could not find a suitable TLS CA certificate bundle OSError: 无法加载库 &#39;C:\\Program Files\\R\\R-4.0.2\\bin\\x64\\R.dll&#39;: 错误 0x7e - OSError: cannot load library 'C:\Program Files\R\R-4.0.2\bin\x64\R.dll': error 0x7e
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM