Saturday, January 23, 2021

Getting error "undefined symbol: OGR_F_GetFieldAsInteger64"

Hi all,

After I install psycopg2, I am getting below error. My package list is shown below. Really appreciate the support of the community to fix this issue.
python: 3.6.5

packages:
Package        Version
-------------- -------
asgiref        3.3.1
Django         3.1.5
django-leaflet 0.27.1
pip            20.3.4
psycopg2       2.7.3
pytz           2020.5
setuptools     51.3.3
sqlparse       0.4.1
wheel          0.36.2

error:
  File "/home/kavindu/Projects/map-engine/map-engine/lib/python3.6/site-packages/django/contrib/auth/models.py", line 2, in <module>
    from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
  File "/home/kavindu/Projects/map-engine/map-engine/lib/python3.6/site-packages/django/contrib/auth/base_user.py", line 48, in <module>
    class AbstractBaseUser(models.Model):
  File "/home/kavindu/Projects/map-engine/map-engine/lib/python3.6/site-packages/django/db/models/base.py", line 122, in __new__
    new_class.add_to_class('_meta', Options(meta, app_label))
  File "/home/kavindu/Projects/map-engine/map-engine/lib/python3.6/site-packages/django/db/models/base.py", line 326, in add_to_class
    value.contribute_to_class(cls, name)
  File "/home/kavindu/Projects/map-engine/map-engine/lib/python3.6/site-packages/django/db/models/options.py", line 206, in contribute_to_class
    self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
  File "/home/kavindu/Projects/map-engine/map-engine/lib/python3.6/site-packages/django/db/__init__.py", line 28, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "/home/kavindu/Projects/map-engine/map-engine/lib/python3.6/site-packages/django/db/utils.py", line 214, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "/home/kavindu/Projects/map-engine/map-engine/lib/python3.6/site-packages/django/db/utils.py", line 111, in load_backend
    return import_module('%s.base' % backend_name)
  File "/home/kavindu/Projects/map-engine/map-engine/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/kavindu/Projects/map-engine/map-engine/lib/python3.6/site-packages/django/contrib/gis/db/backends/postgis/base.py", line 6, in <module>
    from .features import DatabaseFeatures
  File "/home/kavindu/Projects/map-engine/map-engine/lib/python3.6/site-packages/django/contrib/gis/db/backends/postgis/features.py", line 1, in <module>
    from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures
  File "/home/kavindu/Projects/map-engine/map-engine/lib/python3.6/site-packages/django/contrib/gis/db/backends/base/features.py", line 3, in <module>
    from django.contrib.gis.db import models
  File "/home/kavindu/Projects/map-engine/map-engine/lib/python3.6/site-packages/django/contrib/gis/db/models/__init__.py", line 3, in <module>
    import django.contrib.gis.db.models.functions  # NOQA
  File "/home/kavindu/Projects/map-engine/map-engine/lib/python3.6/site-packages/django/contrib/gis/db/models/functions.py", line 3, in <module>
    from django.contrib.gis.db.models.fields import BaseSpatialField, GeometryField
  File "/home/kavindu/Projects/map-engine/map-engine/lib/python3.6/site-packages/django/contrib/gis/db/models/fields.py", line 3, in <module>
    from django.contrib.gis import forms, gdal
  File "/home/kavindu/Projects/map-engine/map-engine/lib/python3.6/site-packages/django/contrib/gis/forms/__init__.py", line 3, in <module>
    from .fields import (  # NOQA
  File "/home/kavindu/Projects/map-engine/map-engine/lib/python3.6/site-packages/django/contrib/gis/forms/fields.py", line 2, in <module>
    from django.contrib.gis.gdal import GDALException
  File "/home/kavindu/Projects/map-engine/map-engine/lib/python3.6/site-packages/django/contrib/gis/gdal/__init__.py", line 28, in <module>
    from django.contrib.gis.gdal.datasource import DataSource
  File "/home/kavindu/Projects/map-engine/map-engine/lib/python3.6/site-packages/django/contrib/gis/gdal/datasource.py", line 39, in <module>
    from django.contrib.gis.gdal.driver import Driver
  File "/home/kavindu/Projects/map-engine/map-engine/lib/python3.6/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 "/home/kavindu/Projects/map-engine/map-engine/lib/python3.6/site-packages/django/contrib/gis/gdal/prototypes/ds.py", line 71, in <module>
    get_field_as_integer64 = int64_output(lgdal.OGR_F_GetFieldAsInteger64, [c_void_p, c_int])
  File "/home/kavindu/anaconda3/lib/python3.6/ctypes/__init__.py", line 361, in __getattr__
    func = self.__getitem__(name)
  File "/home/kavindu/anaconda3/lib/python3.6/ctypes/__init__.py", line 366, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib/libgdal.so.1: undefined symbol: OGR_F_GetFieldAsInteger64


Thank you in advance,
Kavindu

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/84629baf-5774-4ede-ad54-080215d17759n%40googlegroups.com.

No comments:

Post a Comment