Python Ubuntu 14.04+;liblwgeom-2.1.1博士后

Python Ubuntu 14.04+;liblwgeom-2.1.1博士后,python,django,postgresql,ubuntu,geos,Python,Django,Postgresql,Ubuntu,Geos,我有一个项目在我的电脑上工作,我决定将我的ubuntu更新到14.04,我的项目停止了工作=[ 我使用的是python/django和postgres,我使用的libs是: from django.contrib.gis.geos import GEOSGeometry from django.contrib.gis.measure import D from django.contrib.auth.models import User 现在,当我运行使用这些libs之一的脚本时,我得到了以下

我有一个项目在我的电脑上工作,我决定将我的ubuntu更新到14.04,我的项目停止了工作=[

我使用的是python/django和postgres,我使用的libs是:

from django.contrib.gis.geos import GEOSGeometry
from django.contrib.gis.measure import D
from django.contrib.auth.models import User
现在,当我运行使用这些libs之一的脚本时,我得到了以下错误:

Internal Server Error: /get-menus-categorized/
Traceback (most recent call last):
  File "/home/bug/virtualenvs/menuchefs/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/home/bug/projects/menuchef/menuchef/core/views.py", line 985, in get_menus_categorized
    item = {'id':menu.id, 'title':menu.title, 'photo':menu.photo.url, 'description':menu.description, 'restaurant_slug':menu.restaurant.slug, 'number_of_likes':menu.number_of_likes}
  File "/home/bug/virtualenvs/menuchefs/local/lib/python2.7/site-packages/django/db/models/fields/related.py", line 384, in __get__
    rel_obj = qs.get(**params)
  File "/home/bug/virtualenvs/menuchefs/local/lib/python2.7/site-packages/django/db/models/query.py", line 382, in get
    num = len(clone)
  File "/home/bug/virtualenvs/menuchefs/local/lib/python2.7/site-packages/django/db/models/query.py", line 90, in __len__
    self._result_cache = list(self.iterator())
  File "/home/bug/virtualenvs/menuchefs/local/lib/python2.7/site-packages/django/db/models/query.py", line 301, in iterator
    for row in compiler.results_iter():
  File "/home/bug/virtualenvs/menuchefs/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 775, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/home/bug/virtualenvs/menuchefs/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 840, in execute_sql
    cursor.execute(sql, params)
  File "/home/bug/virtualenvs/menuchefs/local/lib/python2.7/site-packages/django/db/backends/util.py", line 41, in execute
    return self.cursor.execute(sql, params)
  File "/home/bug/virtualenvs/menuchefs/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 58, in execute
    six.reraise(utils.DatabaseError, utils.DatabaseError(*tuple(e.args)), sys.exc_info()[2])
  File "/home/bug/virtualenvs/menuchefs/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 54, in execute
    return self.cursor.execute(query, args)
DatabaseError: could not load library "/usr/lib/postgresql/9.3/lib/postgis-2.1.so": /usr/lib/liblwgeom-2.1.2.so: undefined symbol: GEOSDelaunayTriangulation

我正在考虑降级我的ubuntu版本。有什么线索吗?

在标准
升级后,我遇到了同样的问题,其中包括第9.3页的postgis

Preparing to replace liblwgeom-2.1.2 2.1.2+dfsg-1.pgdg12.4+4 (using .../liblwgeom-2.1.2_2.1.3+dfsg-1.pgdg12.4+7_i386.deb) ...
Unpacking replacement liblwgeom-2.1.2 ...
(...)
Preparing to replace postgresql-9.3-postgis-scripts 2.1.2+dfsg-1.pgdg12.4+4 (using .../postgresql-9.3-postgis-scripts_2.1.3+dfsg-3.pgdg12.4+2_all.deb) ...
Unpacking replacement postgresql-9.3-postgis-scripts ...
Preparing to replace postgresql-9.3-postgis-2.1-scripts 2.1.2+dfsg-1.pgdg12.4+4 (using .../postgresql-9.3-postgis-2.1-scripts_2.1.3+dfsg-3.pgdg12.4+2_all.deb) ...
Unpacking replacement postgresql-9.3-postgis-2.1-scripts ...
(...)
Setting up liblwgeom-2.1.2 (2.1.3+dfsg-1.pgdg12.4+7) ...
(...)
Setting up postgresql-9.3-postgis-scripts (2.1.3+dfsg-3.pgdg12.4+2) ...
Setting up postgresql-9.3-postgis-2.1-scripts (2.1.3+dfsg-3.pgdg12.4+2) ...
似乎
liblwgeom-2.1.3。因此
取代了2.1.2版本。在
/usr/lib
中创建一个sym链接,它会再次工作:

sudo ln -s liblwgeom-2.1.3.so liblwgeom-2.1.2.so

扩展加载后,我可以处理空间数据,但我还没有进行彻底的测试,看看是否一切都像广告中所说的那样正常(但小版本升级的向后兼容性通常不成问题).

看来您的升级没有更新PostGIS,因此它仍然链接到与您系统上的版本不匹配的
libgeos
。确保您在
/etc/apt/sources.list
/etc/apt/sources.list.d
中检查了postgresql的sources.list条目,前提是它明确地命名了旧发行版,而不是使用占位符,您需要更改版本,然后
apt-get-update;apt-get-upgrade
。我在Ubuntu 14.04内核3.13上遇到了同样的问题,不幸的是,这个解决方案不起作用。