2014-05-11 86 views
2

我有一個項目,我的電腦上工作,我決定來更新我的Ubuntu 14.04給我的項目停止工作= [的Ubuntu 14.04 + liblwgeom-2.1.1的Postgres

我使用python/Django和Postgres的和我使用這些庫:

from django.contrib.gis.geos import GEOSGeometry 
from django.contrib.gis.measure import D 
from django.contrib.auth.models import User 

,現在當我運行一些腳本,使用學位論文庫我得到了以下錯誤之一:

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版本。任何有線索?

+0

看起來您的升級並未更新PostGIS,因此它仍與鏈接到與您的系統上的內容不匹配的'libgeos'版本。確保你在'/ etc/apt/sources.list'或'/ etc/apt/sources.list.d'中檢查了postgresql的sources.list條目 - 如果它明確指定了舊的發行版本,而不是使用佔位符'需要更改版本,然後'apt-get update; apt-get upgrade'。 –

回答

2

我有一個標準的apt-get upgrade,其中包括PG 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.so取代了2.1.2版本。在/usr/lib創建符號鏈接,它再次工作:

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

的擴展負載,我可以用空間數據的工作,但我沒有做徹底的測試,看看是否一切仍像宣傳的那樣(但向後兼容性上小版本升級通常不會成爲問題)。

+0

我在內核3.13的Ubuntu 14.04上遇到了同樣的問題,不幸的是這個解決方案不起作用。 –