Hello~when I import specific package from shapely, input the follow
from shapely.geometry import Point, Polygon
from shapely.geometry.polygon import LinearRing, LineString
but seem to be failed to load them, The feedback was following:
---------------------------------------------------------------------------
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
then I go to the due file location, the py documents could not be open.
Could you help me import the pakage?
Further tries but didn't work:
α
1. download the OSGeo4W64
into C:\
- create a folder
bin
- manually copied
geos_c.dll
fromshapely\DLL
into the folder
β reinstall shapely package via
pip uninstall shapely
pip install shapely
obtained latest version 1.7, when I look into the package modules' code, they were complete.
γ submitted a issue on github -Toblerity/Shapely but hinted we should submit it on conda page.