[英]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.