Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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
sys.path.append('path_to_library')
#And then
import shapely
share|improve this answer
    
Great, it worked!! Thank you very much! –  Martin Jun 28 '13 at 11:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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