无法导入cartopy

Ubi*_*ons 4 python import installation cartopy google-colaboratory

在 google-colab 上安装 cartopy 后,我无法导入它:

!pip install cartopy
import cartopy

ImportError: cannot import name lgeos
Run Code Online (Sandbox Code Playgroud)

小智 7

是的,通过降级 Shapely:

pip install shapely==1.8.5
Run Code Online (Sandbox Code Playgroud)

为我工作。(在谷歌合作实验室)


dan*_*ild 5

我遇到了同样的问题(使用google-colab),这似乎源于此 Cartopy/Shapelyv2.0兼容性问题: https: //github.com/SciTools/cartopy/issues/2076

更多踪迹:

import cartopy.trace
  File "lib/cartopy/trace.pyx", line 77, in init cartopy.trace
ImportError: cannot import name lgeos
Run Code Online (Sandbox Code Playgroud)

我使用 pip,并明确将 Shapely 降级到1.8.5对我有用的版本。