python - 找不到模块(或其依赖项之一)。尝试使用带有构造函数语法的完整路径
问题描述
当我运行命令时:
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.
我该如何解决?
解决方案
我遇到了同样的问题。我在带有 conda 环境的 Windows 10 上使用 Pycharm。我使用 pip 将软件包安装在我的 requirements.txt 文件中。
我正在使用取决于地理位置的 Shapely。似乎 pip 没有安装该依赖项,所以我所做的是首先删除 Shapely:
pip uninstall shapely
然后,我使用 conda 安装包(geos 也安装了),一切正常。
conda install shapely
我想如果你使用pip,如果没有安装geos,你可以单独安装(我没有测试):
pip install geos
推荐阅读
- r - 将多个文件加载到 R > 2GB
- windows - 如何从我的 Windows 系统访问在 ubuntu 中作为容器运行的 Web 应用程序
- html - 如何使用套接字 io 仅用于服务器客户端通信?
- c# - Entity Framework Core 到 SQL Server IN 子句
- c# - RESTFUL Web 服务 v 使用 Scatter Gatherer 时的消息队列
- c# - c# 将列表项传输到列表框
- java - 从同名类继承Java
- powershell - 启用 Windows Office 功能(OneNote Office Standard 2013)
- java - 无法使用 Buildozer 编译 APK
- c++ - 写代码,不会导致很多页错误