[Tutor] Help with Import Error problems
Roy Khristopher Bayot
roybayot at gmail.com
Sun Aug 1 19:35:26 CEST 2010
I got it back working. But it was with some stroke of luck. And I dont know
I installed the latest source of GEOS (as suggested by someone from the gdal
channel). Then i tried the script. It gave me a different import error.
ImportError: libgeos-3.3.0.so: cannot open shared object file: No such file
I uninstalled the thing. And then tried the script again and it worked. :| I
answered some of your questions below. Again, thanks.
On Sun, Aug 1, 2010 at 10:39 PM, Evert Rol <evert.rol at gmail.com> wrote:
> > Hi. Good day.
> > I am having an import error problem. Last week, I was following this
> I was able to make the python script run on the terminal. But this week, it
> was throwing some error.
> > This was the traceback:
> > Traceback (most recent call last):
> > File "aster_convert.py", line 2, in <module>
> > from osgeo import gdal
> > File "/usr/lib/python2.6/dist-packages/osgeo/__init__.py", line 21, in
> > _gdal = swig_import_helper()
> > File "/usr/lib/python2.6/dist-packages/osgeo/__init__.py", line 17, in
> > _mod = imp.load_module('_gdal', fp, pathname, description)
> > ImportError: /usr/lib/libspatialite.so.2: undefined symbol: GEOSSimplify
> > I tried google-ing for the ImportError but the results dont make sense.
> It was working last week. I might have installed something that "broke" it
> but I dont know how to trace it back.
> > Could I ask for some pointers on how to fix this?
> I have absolutely no experience with the libraries you're using, but the
> error tells you that libspatialite is expected to have the symbol
> GEOSSimplify (could be a function or a class definition, for example), which
> isn't found.
> The first Google hit for libspatialite results in
> http://www.gaia-gis.it/spatialite/how_to_build_libspatialite.html , which
> mentions two required dependencies: PROJ.4 and GEOS. Probably the latter
> provides GEOSSimplify.
> So, you've either uninstalled the GEOS library, your LD_ LIBRARY_PATH
> settings settings aren't what they were a week ago, or you've reinstalled
> libspatialite, but this time with the no-geos option.
> For a quick check, try the following from the command line:
> $> ldd /usr/lib/libspatialite.so.2
The command line returns the following lines:
linux-vdso.so.1 => (0x00007fff6edff000)
libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0x00007f793015c000)
libgeos_c.so.1 => /usr/local/lib/libgeos_c.so.1 (0x00007f792ff4f000)
libgeos-3.2.2.so => /usr/lib/libgeos-3.2.2.so (0x00007f792fbe8000)
libproj.so.0 => /usr/lib/libproj.so.0 (0x00007f792f9a6000)
libm.so.6 => /lib/libm.so.6 (0x00007f792f723000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f792f40e000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007f792f1f1000)
libdl.so.2 => /lib/libdl.so.2 (0x00007f792efed000)
libc.so.6 => /lib/libc.so.6 (0x00007f792ec69000)
libgeos.so.2 => /usr/local/lib/libgeos.so.2 (0x00007f792e964000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f792e74d000)
I dont know what to make of it.
and see if it has any missing dependencies. If there's any missing (you can
> also post the output here if you'd like), see if you can that dependency
> somewhere on your system (the 'locate' command can help, or just good-old
> 'find'). If it's missing from libspatialite but you can find that library
> somewhere on your system (that would probably be the GEOS library then),
> it's your LD_LIBRARY_PATH that's likely different.
> Also, what linux distro are you using? Maybe you've been using the package
> manager overzealously, causing some essential packages to be modified or
I'm on Ubuntu 10.04 (64 bit). I think it was from installing different
GIS-related software (not all of which could be installed from the package
> And how did you install libspatialite; or for that matter, osgeo?
I didnt install them both explicitly. I think it's a dependency from GRASS.
> > Thank you.
> > Roy
> > P.S. I dont know if this is the right list to post this. If it isnt, I'm
> sorry for the inconvenience. Kindly direct me to the right one.
> If libspatialite or osgeo has a mailing list, you could (also) try that
> one. While this error shows up in Python, it's more likely a generic
> installation/system settings problems. Which are often tricky to find the
> correct mailing list for, actually, as long as it's not clear what's the
> underlying cause.
> Good luck, and let us know what you find.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor