[GeoNode-users] Import Error for _gdal

Xenia Specka specka at zalf.de
Mon Jul 18 00:41:38 PDT 2016


Hello,

 

I am trying to install geonode 2.4 in Windows 8.1 virtual machine and now I am some confusing problems with the osgeo installation, that I cannot understand.

 

I followed the installation guidelines from http://docs.geonode.org/en/master/tutorials/devel/devel_env/win_devinstall.html

 

I use Python 2.7.9 and virtualenv for the Geonode installation. I have download the GDAL libraries from http://www.gisinternals.com/release.php using the version of build v1500 and AMD64, as this is the Version of my Python installation. I checked-out the stable branch 2.4.x from Geonode. 

 

When I activate my virtualenv environment and execute “python manage.py createsuperuser” I get the following error log.

 

Traceback (most recent call last):

  File "manage.py", line 28, in <module>

    execute_from_command_line(sys.argv)

  File "c:\ENV\geonode\lib\site-packages\django\core\management\__init__.py", li

ne 399, in execute_from_command_line

    utility.execute()

  File "c:\ENV\geonode\lib\site-packages\django\core\management\__init__.py", li

ne 392, in execute

    self.fetch_command(subcommand).run_from_argv(self.argv)

  File "c:\ENV\geonode\lib\site-packages\django\core\management\base.py", line 2

42, in run_from_argv

    self.execute(*args, **options.__dict__)

  File "c:\ENV\geonode\lib\site-packages\django\core\management\base.py", line 2

84, in execute

    self.validate()

  File "c:\ENV\geonode\lib\site-packages\django\core\management\base.py", line 3

10, in validate

    num_errors = get_validation_errors(s, app)

  File "c:\ENV\geonode\lib\site-packages\django\core\management\validation.py",

line 34, in get_validation_errors

    for (app_name, error) in get_app_errors().items():

  File "c:\ENV\geonode\lib\site-packages\django\db\models\loading.py", line 196,

in get_app_errors

    self._populate()

  File "c:\ENV\geonode\lib\site-packages\django\db\models\loading.py", line 78,

in _populate

    self.load_app(app_name)

  File "c:\ENV\geonode\lib\site-packages\django\db\models\loading.py", line 99,

in load_app

    models = import_module('%s.models' % app_name)

  File "c:\ENV\geonode\lib\site-packages\django\utils\importlib.py", line 40, in

import_module

    __import__(name)

  File "c:\ENV\geonode\lib\site-packages\modeltranslation\models.py", line 84, i

n <module>

    handle_translation_registrations()

  File "c:\ENV\geonode\lib\site-packages\modeltranslation\models.py", line 80, i

n handle_translation_registrations

    autodiscover()

  File "c:\ENV\geonode\lib\site-packages\modeltranslation\models.py", line 31, i

n autodiscover

    import_module(module)

  File "c:\ENV\geonode\lib\site-packages\django\utils\importlib.py", line 40, in

import_module

    __import__(name)

  File "C:\ENV\geonode\geonode\base\translation.py", line 2, in <module>

    from geonode.base.models import (TopicCategory, SpatialRepresentationType, R

egion,

  File "C:\ENV\geonode\geonode\base\models.py", line 28, in <module>

    from geonode.utils import bbox_to_wkt

  File "C:\ENV\geonode\geonode\utils.py", line 28, in <module>

    from osgeo import ogr

  File "c:\ENV\geonode\lib\site-packages\osgeo\__init__.py", line 26, in <module

> 

    _gdal = swig_import_helper()

  File "c:\ENV\geonode\lib\site-packages\osgeo\__init__.py", line 21, in swig_im

port_helper

    _mod = imp.load_module('_gdal', fp, pathname, description)

ImportError: DLL load failed: Die angegebene Prozedur wurde nicht gefunden.

 

(geonode) C:\ENV\geonode>

 

 

I have read a lot in the internet  and understand what this error usually means. But sadly, this cannot be the case of my problems. I double-checked the correct version of gdal and the osgeo library so that it is of the same version as my Python install. 

 

Command line output for starting python and manually importing osgeo in the virtualenv environment:

 

(geonode) C:\ENV\geonode>python

Python 2.7.9 (default, Dec 10 2014, 12:28:03) [MSC v.1500 64 bit (AMD64)] on win

32

Type "help", "copyright", "credits" or "license" for more information.

>>> import osgeo

1.11.4

>>> 

 

 

If I start Python in the virtualenv environment and execute every step of the __init__.py of the osgeo package manually, there is no error. In the Python console, I can import osgeo or ogr from osgeo without any problems. But when executing the manage.py script where, at some point, the __init__.py from osgeo is called, the above described error is thrown.

 

I used 64bit installation packages, but also tried the same installation with only 32bit packages. For both variants, the error occurs.

 

Does anybody knows, what the cause of this confusing error might be? 

 

Cheers,

Xenia

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20160718/a238b601/attachment.html>


More information about the geonode-users mailing list