In my Anaconda 2.2 64bit with Python 3.4.3 the following line works well:
import shapely
But the following line:
from shapely.geometry.polygon import Polygon
returns the following error:
OSError: [WinError 126] The specified module could not be found
What am I missing?
EDIT
I tried with iNotebook, idle.exe and Eclipse. They all use Anaconda (the only Python installation on my computer) and they all show the same error.
If I type from shapely.geometry import Polygon
in Eclipse, then I click on Polygon
, then I press F3
, Eclipse is able to open the module C:\Anaconda3\Lib\site-packages\shapely\geometry\polygon.py
. So Eclipse is able to find it, but the execution fails.
EDIT 2
I just tried the same import on another computer with similar configuration and it works. The "only" difference between the two computers is that one has Windows 7 (it works) and one has Windows 8 (it doesn't).
I installed Anaconda and a few packages in both the computers following the same old checklist. The computer with Windows 8 can see the package from Eclipse, but can't import it.
I had a similar problem and it was due to the way that I improperly installed shapely (although this was on a Windows 7 machine, not Windows 8). For the initial install under which I couldn't import the geometry
sub-module I installed shapely with the command:
pip install shapely
However after reading the documentation here more closely I saw that for Windows an executable installer needed to be used. That installer is a wheel file that needs to be launched by pip as well. So I uninstalled the first version of shapely with:
pip uninstall shapely
Then I launched the installer via the wheel file like this:
pip install your/file/path/Shapely‑1.5.9‑cp27‑none‑win32.whl
Note that you must download the wheel that matches the specs of the version of python that your applying the package to. I have 32-bit (win32
) python 2.7 (p27
) so the package above was the correct one. Note that the reference to 32 or 64 bit in the file name refers to the version of python, not to the version of windows.