微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

from shapely import geometry - 找不到指定的模块

如何解决from shapely import geometry - 找不到指定的模块

我正在尝试安装匀称。它安装成功,但我无法访问 geometry 包。

我试过将 pip 与 pip install shapely 一起使用,从轮子与 pip install C:\...\Scripts\Shapely-1.7.1-cp37-cp37m-win_amd64.whl 一起使用(我的 Python 版本是 3.7)以及将 anaconda 与 conda install -c esri shapely 一起使用。

当我尝试导入 geometry 时,我尝试过的所有方法都会产生相同的错误消息。我已经阅读了其他一些答案,但他们都提出了我现在尝试过的不同安装方法

编辑:还尝试了 from shapely import geometry as geoimport shapely.geometry

还有什么建议吗?

完整的错误输出

OSError                                   Traceback (most recent call last)
<ipython-input-2-160ae635daad> in <module>
----> 1 from shapely import geometry

~\Anaconda3\envs\myenv\lib\site-packages\shapely\geometry\__init__.py in <module>
      2 """
      3 
----> 4 from .base import CAP_STYLE,JOIN_STYLE
      5 from .geo import Box,shape,asShape,mapping
      6 from .point import Point,asPoint

~\Anaconda3\envs\myenv\lib\site-packages\shapely\geometry\base.py in <module>
     17 
     18 from shapely.affinity import affine_transform
---> 19 from shapely.coords import CoordinateSequence
     20 from shapely.errors import WKBReadingError,WKTReadingError
     21 from shapely.geos import WKBWriter,WKTWriter

~\Anaconda3\envs\myenv\lib\site-packages\shapely\coords.py in <module>
      6 from ctypes import byref,c_double,c_uint
      7 
----> 8 from shapely.geos import lgeos
      9 from shapely.topology import Validating
     10 

~\Anaconda3\envs\myenv\lib\site-packages\shapely\geos.py in <module>
    152     if os.getenv('CONDA_PREFIX',''):
    153         # conda package.
--> 154         _lgeos = CDLL(os.path.join(sys.prefix,'Library','bin','geos_c.dll'))
    155     else:
    156         try:

~\Anaconda3\envs\myenv\lib\ctypes\__init__.py in __init__(self,name,mode,handle,use_errno,use_last_error)
    346 
    347         if handle is None:
--> 348             self._handle = _dlopen(self._name,mode)
    349         else:
    350             self._handle = handle

OSError: [WinError 126] The specified module Could not be found

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。