作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我最近下载了 OSMnx 包来处理街道网络。但是,每当我尝试导入包时,它总是给我返回以下错误。我已经按照其他帖子的人建议的几个步骤进行操作,但没有任何改变。如果有人遇到过这个问题或知道解决方法,请与我分享。谢谢!
Traceback (most recent call last):
File "/Users/qle/Documents/OSMnx/test.py", line 1, in <module>
import osmnx as ox
File "/Users/qle/Library/Python/3.8/lib/python/site-packages/osmnx/__init__.py", line 3, in <module>
from ._api import *
File "/Users/qle/Library/Python/3.8/lib/python/site-packages/osmnx/_api.py", line 3, in <module>
from .bearing import add_edge_bearings
File "/Users/qle/Library/Python/3.8/lib/python/site-packages/osmnx/bearing.py", line 9, in <module>
from . import projection
File "/Users/qle/Library/Python/3.8/lib/python/site-packages/osmnx/projection.py", line 3, in <module>
import geopandas as gpd
File "/Users/qle/Library/Python/3.8/lib/python/site-packages/geopandas/__init__.py", line 1, in <module>
from geopandas._config import options # noqa
File "/Users/qle/Library/Python/3.8/lib/python/site-packages/geopandas/_config.py", line 126, in <module>
default_value=_default_use_pygeos(),
File "/Users/qle/Library/Python/3.8/lib/python/site-packages/geopandas/_config.py", line 112, in _default_use_pygeos
import geopandas._compat as compat
File "/Users/qle/Library/Python/3.8/lib/python/site-packages/geopandas/_compat.py", line 202, in <module>
import rtree # noqa
File "/Users/qle/Library/Python/3.8/lib/python/site-packages/rtree/__init__.py", line 9, in <module>
from .index import Rtree, Index # noqa
File "/Users/qle/Library/Python/3.8/lib/python/site-packages/rtree/index.py", line 6, in <module>
from . import core
File "/Users/qle/Library/Python/3.8/lib/python/site-packages/rtree/core.py", line 77, in <module>
rt.Error_GetLastErrorNum.restype = ctypes.c_int
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ctypes/__init__.py", line 386, in __getattr__
func = self.__getitem__(name)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ctypes/__init__.py", line 391, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(RTLD_DEFAULT, Error_GetLastErrorNum): symbol not found
最佳答案
您的错误意味着 rtree
,osmnx
的依赖项,找不到 spatialindex
。
首先,确保安装了 spatialindex
:
brew install spatialindex
下一个问题是 rtree
只检查 very specific locations对于 spatialindex
但 brew 安装到 /opt/homebrew/Cellar
。
您设置 ENV 变量并检查这是否是问题所在
export SPATIALINDEX_C_LIBRARY='/opt/homebrew/Cellar/spatialindex/1.9.3/lib'
python -c 'import geopandas'
它应该可以工作。但是,根据您的空间索引和 brew 版本,此路径可能会发生变化。
关于python-3.x - AttributeError : dlsym(RTLD_DEFAULT, Error_GetLastErrorNum:找不到符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68464704/
我正在尝试在 macOS Mojave 上运行“conda install something”,但我每次都收到此错误: conda install update 这是整个追溯: Traceback
我最近下载了 OSMnx 包来处理街道网络。但是,每当我尝试导入包时,它总是给我返回以下错误。我已经按照其他帖子的人建议的几个步骤进行操作,但没有任何改变。如果有人遇到过这个问题或知道解决方法,请与我
我是一名优秀的程序员,十分优秀!