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 problem with importing "osgeo" module in ubuntu 10.04; I have installed GDAL 1.7 from source ( 1)./configure 2)make) however, still in python I cant import osgeo module. I appreciate any hints.

Basically, I am trying to make the converter script of jvectormap script into work and osgeo module is a prerequisite module.

update 1 ./configure --with-python gives me the following

GDAL is now configured for i686-pc-linux-gnu

  Installation directory:    /usr/local
  C compiler:                gcc -g -O2
  C++ compiler:              g++ -g -O2

  LIBTOOL support:           yes

  LIBZ support:              external
  GRASS support:             no
  CFITSIO support:           no
  PCRaster support:          internal
  NetCDF support:            yes
  LIBPNG support:            external
  LIBTIFF support:           external (BigTIFF=no)
  LIBGEOTIFF support:        internal
  LIBJPEG support:           external
  8/12 bit JPEG TIFF:        no
  LIBGIF support:            external
  OGDI support:              no
  HDF4 support:              yes
  HDF5 support:              yes
  Kakadu support:            no
  JasPer support:            yes (GeoJP2=yes)
  ECW support:               no
  MrSID support:             no
  MSG support:               no
  GRIB support:              yes
  EPSILON support:           no
  cURL support (wms/wcs/...):yes
  PostgreSQL support:        yes
  MySQL support:             no
  Ingres support:            no
  Xerces-C support:          yes
  NAS support:               no
  Expat support:             yes
  ODBC support:              yes
  PGeo support:              yes
  PCIDSK support:            internal
  OCI support:               no
  GEORASTER support:         no
  SDE support:               no
  DODS support:              no
  SQLite support:            yes
  SpatiaLite support:        no
  DWGdirect support          no
  INFORMIX DataBlade support:no
  GEOS support:              yes
  VFK support:               yes


  SWIG Bindings:          python 

  Statically link PROJ.4:    no
  enable OGR building:       yes
  enable pthread support:    no
  hide internal symbols:     no

update 2

after importing gdal, I am getting the following complains:

>>> import gdal
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.6/dist-packages/GDAL-1.7.1-py2.6-linux-i686.egg/gdal.py", line 2, in <module>
    from osgeo.gdal import deprecation_warn
  File "/usr/local/lib/python2.6/dist-packages/GDAL-1.7.1-py2.6-linux-i686.egg/osgeo/__init__.py", line 21, in <module>
    _gdal = swig_import_helper()
  File "/usr/local/lib/python2.6/dist-packages/GDAL-1.7.1-py2.6-linux-i686.egg/osgeo/__init__.py", line 17, in swig_import_helper
    _mod = imp.load_module('_gdal', fp, pathname, description)
ImportError: libgdal.so.1: cannot open shared object file: No such file or directory

I tried to see where the package is install :

$ /sbin/ldconfig -p | grep gdal
    libgdal1.7.0.so.1 (libc6) => /usr/lib/libgdal1.7.0.so.1
    libgdal1.6.0.so.1 (libc6) => /usr/lib/libgdal1.6.0.so.1
    libgdal1.6.0.so (libc6) => /usr/lib/libgdal1.6.0.so
share|improve this question
1  
try updating dynamic linker run-time bindings with: sudo ldconfig –  Mike T Jun 26 '13 at 23:34
    
now works ! with a warning though, >>> import gdal /usr/local/lib/python2.6/dist-packages/GDAL-1.7.1-py2.6-linux-i686.egg/osgeo/gda‌​l.py:80: DeprecationWarning: gdal.py was placed in a namespace, it is now available as osgeo.gdal DeprecationWarning) –  user702846 Jun 26 '13 at 23:44

1 Answer 1

If you install GDAL from source and you want the GDAL Python bindings, you need to configure it with Python:

./configure --with-python

In your output you should find:

...
Poppler support:           no
Podofo support:            no
OpenCL support:            no
Armadillo support:         no
FreeXL support:            yes

SWIG Bindings:             python

Statically link PROJ.4:    no
enable OGR building:       yes
...
share|improve this answer
    
and then ?! still, "No module named osgeo" from python; please have a look at update as well :-) –  user702846 Jun 26 '13 at 15:28

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.