导入异常失败(win64python3.x)

时间:2020-04-26 07:13:49

标签: python python-3.x shapely

你好〜当我从Shape导入特定包时,输入以下内容

from shapely.geometry import Point, Polygon
from shapely.geometry.polygon import LinearRing, LineString

但似乎无法加载它们,反馈如下:

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-4-452b9f8a12ab> in <module>
      1 #Shapely Library
----> 2 from shapely.geometry import Point, Polygon
      3 from shapely.geometry.polygon import LinearRing, LineString

C:\ProgramData\Anaconda3\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

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

C:\ProgramData\Anaconda3\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 

C:\ProgramData\Anaconda3\lib\site-packages\shapely\geos.py in <module>
    143     if os.getenv('CONDA_PREFIX', ''):
    144         # conda package.
--> 145         _lgeos = CDLL(os.path.join(sys.prefix, 'Library', 'bin', 'geos_c.dll'))
    146     else:
    147         try:

C:\ProgramData\Anaconda3\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
    362 
    363         if handle is None:
--> 364             self._handle = _dlopen(self._name, mode)
    365         else:
    366             self._handle = handle

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

然后我转到相应的文件位置,无法打开py文档。

您能帮我导入包装吗?

进一步尝试但没有成功:

α 1.将OSGeo4W64下载到C:\

  1. 创建文件夹bin
  2. geos_c.dll手动将shapely\DLL复制到文件夹

β 通过

重新安装整齐的软件包
pip uninstall shapely

pip install shapely

获得了最新版本1.7,当我查看软件包模块的代码时,它们已经完成。

γ 在github -Toblerity / Shapely上提交了一个问题,但暗示我们应该在conda页面上提交它。

0 个答案:

没有答案