0

when i migrate in django
the django have return error below

$ python manager.py migrate

django.db.utils.InternalError: could not load library "/usr/lib/postgresql/9.6/lib/postgis-2.3.so": /usr/lib/liblwgeom-2.3.so.0: undefined symbol: GEOSClipByRect

i researched many posts but not found any solution.
Does anyone know the solution?
my system info is below


$ lsb_release -a

Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial



$ dpkg -l | grep postgres

ii postgresql-9.6 9.6.2-1.pgdg16.04+1 amd64 object-relational SQL database, version 9.6 server
ii postgresql-9.6-pgrouting 2.3.2+ds-2.pgdg16.04+1 amd64 Routing functionality support for PostgreSQL/PostGIS
ii postgresql-9.6-pgrouting-scripts 2.3.2+ds-2.pgdg16.04+1 all Routing functionality support for PostgreSQL/PostGIS - scripts
ii postgresql-9.6-postgis-2.3 2.3.2+dfsg-1~exp2.pgdg16.04+1 amd64 Geographic objects support for PostgreSQL 9.6
ii postgresql-9.6-postgis-2.3-scripts 2.3.2+dfsg-1~exp2.pgdg16.04+1 all Geographic objects support for PostgreSQL 9.6 -- scripts
ii postgresql-client-9.6 9.6.2-1.pgdg16.04+1 amd64 front-end programs for PostgreSQL 9.6
ii postgresql-client-common 180.pgdg16.04+1 all manager for multiple PostgreSQL client versions
ii postgresql-common 180.pgdg16.04+1 all PostgreSQL database-cluster manager
ii postgresql-contrib 9.6+180.pgdg16.04+1 all additional facilities for PostgreSQL (supported version)
ii postgresql-contrib-9.6 9.6.2-1.pgdg16.04+1 amd64 additional facilities for PostgreSQL



$ dpkg -l | grep postgres

ii postgis 2.3.2+dfsg-1~exp2.pgdg16.04+1 amd64 Geographic objects support for PostgreSQL
ii postgis-doc 2.3.2+dfsg-1~exp2.pgdg16.04+1 all Geographic objects support for PostgreSQL -- documentation
ii postgresql-9.6-postgis-2.3 2.3.2+dfsg-1~exp2.pgdg16.04+1 amd64 Geographic objects support for PostgreSQL 9.6
ii postgresql-9.6-postgis-2.3-scripts 2.3.2+dfsg-1~exp2.pgdg16.04+1 all Geographic objects support for PostgreSQL 9.6 -- scripts

이경훈
  • 39
  • 1
  • 4
  • It is obvious that the `liblwgeom` you have installed is not the correct one for the PostGIS version, but I don't know enough about Ubuntu packaging to help you any further. – Laurenz Albe Apr 24 '17 at 11:31
  • thanks you for answer, i will search correct liblwgeom version! – 이경훈 Apr 26 '17 at 05:06

1 Answers1

1

It's quite likely that you're using an older version of GEOS(I'm guessing 3.4. You can find out the version by running geos-config --version). What you need to do is uninstall the current version of GEOS and reinstall a newer version:

Delete the geos files from /usr/bin /usr/local/bin usr/lib usr/local/lib. Should be fairly easy to identify

Run the following to install version 3.5:

$ wget http://download.osgeo.org/geos/geos-3.5.1.tar.bz2

$ tar xjf geos-3.5.1.tar.bz2

$ cd geos-3.5.2

$ ./configure

$ make

$ sudo make install

$ sudo ldconfig

Edit: Use the most relevant version of GEOS for your project. It's not mandatory to use 3.5