Error when importing geopandas OSError: Could not find lib c or load any of its variants []

Error when importing geopandas OSError: Could not find lib c or load any of its variants []

我将 Spyder 与 Anaconda 一起使用,并且自从 MacOS 上次更新(Big Sur 11.0.1)以来,在做 import geopandas,我收到以下错误:

OSError: Could not find lib c or load any of its variants [].

有几个主题(特别是this one and this one),主要建议通过在终端中输入来重置环境变量DYLD_FALLBACK_LIBRARY_PATH

export DYLD_FALLBACK_LIBRARY_PATH=$(HOME)/lib:/usr/local/lib:/lib:/usr/lib

然而,这是我得到的:

-bash: HOME: command not found

brewpip 安装也没有解决问题。

有人知道我该如何解决这个问题吗?我应该用什么来代替 $(HOME) 吗?

非常感谢!

我遇到了同样的问题。要解决此问题,请使用:

更改 Shapely 包

https://github.com/Toblerity/Shapely/commit/a34ec59a7dc9089a71968c6871e29addd872ea3b

然后重新安装Xcode:

xcode-select --install

您需要修改的 geos.py 文件和行号将在生成 OSError 的日志输出中。只看几行。

我遇到了同样的错误并通过重新安装 Shapely 修复了它:

pip install --upgrade --force-reinstall shapely

供参考:我最终在 Anaconda 上重新安装了一个新环境,它可以工作,但我无法解决原来的问题。