bellockk / alphashape

Toolbox for constructing alpha shapes.
MIT License
252 stars 28 forks source link

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

Closed LAUBENicolas closed 3 years ago

LAUBENicolas commented 3 years ago

Description

After installing alphashape I get this error when I try to import alphashape:

Traceback (most recent call last): File "computer_vision/segmentation/concave_hull_segmentation.py", line 7, in from alphashape import alphashape File "C:\Users\nlb\Anaconda3\envs\ai_platform\lib\site-packages\alphashape__init.py", line 6, in from .alphashape import alphashape File "C:\Users\nlb\Anaconda3\envs\ai_platform\lib\site-packages\alphashape\alphashape.py", line 8, in from shapely.ops import cascaded_union, polygonize File "C:\Users\nlb\Anaconda3\envs\ai_platform\lib\site-packages\shapely\ops.py", line 13, in from shapely.prepared import prep File "C:\Users\nlb\Anaconda3\envs\ai_platform\lib\site-packages\shapely\prepared.py", line 5, in from shapely.geos import lgeos File "C:\Users\nlb\Anaconda3\envs\ai_platform\lib\site-packages\shapely\geos.py", line 154, in _lgeos = CDLL(os.path.join(sys.prefix, 'Library', 'bin', 'geos_c.dll')) File "C:\Users\nlb\Anaconda3\envs\ai_platform\lib\ctypes\init.py", line 364, in init__ self._handle = _dlopen(self._name, mode) OSError: [WinError 126] The specified module could not be found

What I Did

from alphashape import alphashape, optimizealpha
points = [(0., 0.), (0., 1.), (1., 1.), (1., 0.), (0.5, 0.25), (0.5, 0.75), (0.25, 0.5), (0.75, 0.5)]
alpha = 0.95 * alphashape.optimizealpha(points)
hull = alphashape.alphashape(points, alpha)
LAUBENicolas commented 3 years ago

Using conda for the installation solved the problem. (I forgot to use forge as mentionned in the docs)