Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to use jython with GDAL on Windows. Python and GDAL are installed through MS4W and work perfectly together. Jython is installed manually, but I can not import GDAL. I tried to update sys.path on Jython to point to all python sys.path.

But it displays the following error message:

> Traceback (most recent call last):    
> File "C: \",
> line 38, in <module>
>      OSGeo import    File "C: \ OSGeo4W \ apps \ Python25 \ lib \ site-packages \ OSGeo \", line 24, in <module>
>      _gdal import ImportError: No module named _gdal

Has anyone worked with Jython and GDAL? Any ideas to solve the problem? Thank you!

share|improve this question

Jython is Python for the JVM. GDAL is not going to be accessible like this. If you want to use the GDAL bindings, you'll need to use the (C) Python in C:\OSGeo4W\apps\Python25.

If you want to stick with Jython, take a look at importing classes from GeoTools or Geotk.

share|improve this answer

According to the Jython FAQ you can't use the standard gdal python bindings (yet):

Jython programs cannot currently use CPython extension modules written in C. These modules usually have files with the extension .so, .pyd or .dll. If you want to use such a module, you should look for an equivalent written in pure Python or Java. However, it is technically feasible to support such extensions, as demonstrated by IronPython. For the next release of Jython, we plan to support the C Python Extension API.

The binaries that can be downloaded from contain Java bindings, though I have no idea if you can use them in Jython.

share|improve this answer

Your Answer


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.