我正试图让GemGIS工作。在安装过程中,我安装了库geopandas和在我的环境中通过:
conda install -c conda-forge geopandas
和
pip install gemgis
我用了蟒蛇的powershell,一切似乎都很好。当我启动jupyter lab并试图导入这些包时,我得到了以下错误代码:
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-24-a62d01c1d62e> in <module>
----> 1 import geopandas as gpd
G:Programmeanaconda3envsgemgislibsite-packagesgeopandas__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:Programmeanaconda3envsgemgislibsite-packagesgeopandas_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:Programmeanaconda3envsgemgislibsite-packagesgeopandas_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:Programmeanaconda3envsgemgislibsite-packagesgeopandas_compat.py in <module>
147 RTREE_GE_094 = False
148 try:
--> 149 import rtree # noqa
150
151 HAS_RTREE = True
G:Programmeanaconda3envsgemgislibsite-packagesrtree__init__.py in <module>
7 __version__ = '0.9.7'
8
----> 9 from .index import Rtree, Index # noqa
G:Programmeanaconda3envsgemgislibsite-packagesrtreeindex.py in <module>
4 import pprint
5
----> 6 from . import core
7
8 import pickle
G:Programmeanaconda3envsgemgislibsite-packagesrtreecore.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:Programmeanaconda3envsgemgislibsite-packagesrtreefinder.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,因此不会引发错误。