找不到模块(或其依赖项之一)。尝试使用带有构造函数语法的完整路径

Rog*_*ger 4 python geometry multilinestring

当我运行命令时:

from shapely.geometry import LineString

我收到此错误:

Could not find module 'C:\Users\SWWB\Anaconda\Library\bin\geos_c.dll' (or one of its dependencies). Try using the full path with constructor syntax.

我该如何解决?

Ahm*_*tob 7

我遇到了同样的问题。我在带有 conda 环境的 Windows 10 上使用 Pycharm。我使用 pip 在我的 requirements.txt 文件中安装包。

我正在使用取决于地理位置的 Shapely。似乎 pip 没有安装该依赖项,所以我所做的是首先使用以下命令删除 Shapely:

pip uninstall shapely
Run Code Online (Sandbox Code Playgroud)

然后,我使用 conda 安装包(geos 也安装了),一切正常。

conda install shapely
Run Code Online (Sandbox Code Playgroud)

我想如果你使用pip,如果没有安装,你可以单独安装geos(我没有测试):

pip install geos
Run Code Online (Sandbox Code Playgroud)