繁体   English   中英

有没有办法解决geopandas的这个导入错误?

[英]Is there a way to fix this import error for geopandas?

我正在尝试让 GemGIS 工作。 在安装过程中,我通过以下方式在我的环境中安装了库geopandasgemgis

conda install -c conda-forge geopandas

pip install gemgis

我使用了 anaconda powershell,一切看起来都还不错。 当我启动 jupyter lab 并尝试导入这些包时,我收到以下错误代码:

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-24-a62d01c1d62e> in <module>
----> 1 import geopandas as gpd

G:\Programme\anaconda3\envs\gemgis\lib\site-packages\geopandas\__init__.py in <module>
----> 1 from geopandas._config import options  # noqa
      2 
      3 from geopandas.geoseries import GeoSeries  # noqa
      4 from geopandas.geodataframe import GeoDataFrame  # noqa
      5 from geopandas.array import points_from_xy  # noqa

G:\Programme\anaconda3\envs\gemgis\lib\site-packages\geopandas\_config.py in <module>
    124 use_pygeos = Option(
    125     key="use_pygeos",
--> 126     default_value=_default_use_pygeos(),
    127     doc=(
    128         "Whether to use PyGEOS to speed up spatial operations. The default is True "

G:\Programme\anaconda3\envs\gemgis\lib\site-packages\geopandas\_config.py in _default_use_pygeos()
    110 
    111 def _default_use_pygeos():
--> 112     import geopandas._compat as compat
    113 
    114     return compat.USE_PYGEOS

G:\Programme\anaconda3\envs\gemgis\lib\site-packages\geopandas\_compat.py in <module>
    147 RTREE_GE_094 = False
    148 try:
--> 149     import rtree  # noqa
    150 
    151     HAS_RTREE = True

G:\Programme\anaconda3\envs\gemgis\lib\site-packages\rtree\__init__.py in <module>
      7 __version__ = '0.9.7'
      8 
----> 9 from .index import Rtree, Index  # noqa

G:\Programme\anaconda3\envs\gemgis\lib\site-packages\rtree\index.py in <module>
      4 import pprint
      5 
----> 6 from . import core
      7 
      8 import pickle

G:\Programme\anaconda3\envs\gemgis\lib\site-packages\rtree\core.py in <module>
     73 
     74 # load the shared library by looking in likely places
---> 75 rt = finder.load()
     76 
     77 rt.Error_GetLastErrorNum.restype = ctypes.c_int

G:\Programme\anaconda3\envs\gemgis\lib\site-packages\rtree\finder.py in load()
     65             finally:
     66                 os.environ['PATH'] = oldenv
---> 67         raise OSError("could not find or load {}".format(lib_name))
     68 
     69     elif os.name == 'posix':

OSError: could not find or load spatialindex_c-64.dll
'''

Does anyone know how to fix this? I looked up the paths and saw, that the core.py data had similar codes as requested, but the **64** was missing at the end of the spatialindex_c-.dll 

您的rtree安装已损坏。 您可以尝试重新安装它或使用pygeos代替。

推荐的方式(因为我看到你正在使用 conda):

conda install rtree -c conda-forge

或者

conda install pygeos -c conda-forge

使用 pygeos,不使用 rtree,因此不会引发错误。

暂无
暂无

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

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