我一直在尝试使用 conda 虚拟环境和 venv 虚拟环境来安装和运行 geopandas 包。但是,尽管软件包已安装并显示在“pip list”或“conda list”中,但当我尝试在 JupyterLab 或 Notebook 中导入软件包时,我总是会收到以下 OSError 错误,我没有任何信息或经验:
OSError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_61196/1529612126.py in <module>
----> 1 import geopandas
~\miniconda3\envs\qgiscvenv\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
~\miniconda3\envs\qgiscvenv\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 "
~\miniconda3\envs\qgiscvenv\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
~\miniconda3\envs\qgiscvenv\lib\site-packages\geopandas\_compat.py in <module>
200 RTREE_GE_094 = False
201 try:
--> 202 import rtree # noqa
203
204 HAS_RTREE = True
~\AppData\Roaming\Python\Python39\site-packages\rtree\__init__.py in <module>
7 __version__ = '0.9.7'
8
----> 9 from .index import Rtree, Index # noqa
~\AppData\Roaming\Python\Python39\site-packages\rtree\index.py in <module>
4 import pprint
5
----> 6 from . import core
7
8 import pickle
~\AppData\Roaming\Python\Python39\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
~\AppData\Roaming\Python\Python39\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.dll
任何有关此问题的帮助将不胜感激。谢谢!