找不到模块(或其依赖项之一)。尝试使用带有构造函数语法的完整路径
当我运行命令时:
from shapely.geometry import LineString
我收到此错误:
Could not find module 'C:UsersSWWBAnacondaLibrarybingeos_c.dll' (or one of its dependencies). Try using the full path with constructor syntax.
我该如何解决?
回答
我遇到了同样的问题。我在带有 conda 环境的 Windows 10 上使用 Pycharm。我使用 pip 在我的 requirements.txt 文件中安装包。
我正在使用取决于地理位置的 Shapely。似乎 pip 没有安装该依赖项,所以我所做的是首先使用以下命令删除 Shapely:
pip uninstall shapely
然后,我使用 conda 安装包(geos 也安装了),一切正常。
conda install shapely
我想如果你使用pip,如果没有安装,你可以单独安装geos(我没有测试):
pip install geos