paulocheque / django-dynamic-fixture

A complete library to create dynamic model instances for testing purposes.
http://django-dynamic-fixture.readthedocs.io/
Other
391 stars 67 forks source link

Django 1.11.1 GDALException: Could not find the GDAL library #87

Closed vstoykov closed 7 years ago

vstoykov commented 7 years ago

From Django 1.11.1 if django.contrib.gis is imported it will not fail silently if GDAL is not installed. This will make django-dynamic-fixture to trows errors for projects which does not use django.contrib.gis and there is no GDAL isntalled.

    from django_dynamic_fixture import G, F
  File "/usr/local/lib/python2.7/site-packages/django_dynamic_fixture/__init__.py", line 10, in <module>
    from django_dynamic_fixture.fixture_algorithms.sequential_fixture import SequentialDataFixture, \
  File "/usr/local/lib/python2.7/site-packages/django_dynamic_fixture/fixture_algorithms/sequential_fixture.py", line 12, in <module>
    from django.contrib.gis.geos import *
  File "/usr/local/lib/python2.7/site-packages/django/contrib/gis/geos/__init__.py", line 5, in <module>
    from .collections import (  # NOQA
  File "/usr/local/lib/python2.7/site-packages/django/contrib/gis/geos/collections.py", line 11, in <module>
    from django.contrib.gis.geos.geometry import GEOSGeometry, LinearGeometryMixin
  File "/usr/local/lib/python2.7/site-packages/django/contrib/gis/geos/geometry.py", line 11, in <module>
    from django.contrib.gis import gdal
  File "/usr/local/lib/python2.7/site-packages/django/contrib/gis/gdal/__init__.py", line 28, in <module>
    from django.contrib.gis.gdal.datasource import DataSource
  File "/usr/local/lib/python2.7/site-packages/django/contrib/gis/gdal/datasource.py", line 39, in <module>
    from django.contrib.gis.gdal.driver import Driver
  File "/usr/local/lib/python2.7/site-packages/django/contrib/gis/gdal/driver.py", line 5, in <module>
    from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi
  File "/usr/local/lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/ds.py", line 9, in <module>
    from django.contrib.gis.gdal.libgdal import GDAL_VERSION, lgdal
  File "/usr/local/lib/python2.7/site-packages/django/contrib/gis/gdal/libgdal.py", line 44, in <module>
    'GDAL_LIBRARY_PATH in your settings.' % '", "'.join(lib_names)
GDALException: Could not find the GDAL library (tried "gdal", "GDAL", "gdal1.11.0", "gdal1.10.0", "gdal1.9.0", "gdal1.8.0", "gdal1.7.0"). Try setting GDAL_LIBRARY_PATH in your settings.
paulocheque commented 7 years ago

Thanks for reporting! Release 1.9.5 should fix this. Could you try and close this issue if this is ok?

vstoykov commented 7 years ago

Thanks. Everything is working now!