1

I'm trying to install shapely. It installs succesfully but I can't access the geometry package.

I've tried using pip with pip install shapely, from the wheel with pip install C:\...\Scripts\Shapely-1.7.1-cp37-cp37m-win_amd64.whl (my python version is 3.7) and using anaconda with conda install -c esri shapely.

All methods I've tried produce the same error message when I try to import geometry. I've read a few other answers but they've all suggested the different install methods I've now tried.

Edit: Also tried from shapely import geometry as geo and import shapely.geometry.

Any more suggestions?

Full error ouput:

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

DSkwrm
  • 23
  • 3
  • Does this answer your question? [Install Shapely: OSError: \[WinError 126\] The specified module could not be found](https://stackoverflow.com/questions/44398265/install-shapely-oserror-winerror-126-the-specified-module-could-not-be-found) – Georgy Mar 31 '21 at 15:38
  • No, as stated I tried installing with a wheel. – DSkwrm Apr 06 '21 at 17:08

0 Answers0