I have tried to install shapely on Ubuntu 12.10. Therefore I installed libgeos-c1, pip and shapely with $ pip install Shapely. The shapely files are now in /home/user/build/Shapely. When I try to import it in my python script with

from shapely.geometry import Point

gives the following error:

from shapely.geometry import * File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 309, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ImportError: No module named shapely.geometry

Any idea why it is not working?


For easier installation the module is in the repositories:

sudo apt-get install python-shapely

From the directory you said, you've installed the module in a non standard place and not in a path that is being watched by python.

To check which paths are currently active you can issue the following from within the python interpreter:

import sys
print sys.path

Of course you can always append your custom path with

import sys
#And then
import shapely
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.