Python Geodjango应用程序在RHEL6上安装时出错

Python Geodjango应用程序在RHEL6上安装时出错,python,django,postgresql,postgis,rhel6,Python,Django,Postgresql,Postgis,Rhel6,我正在尝试在RHEL 6.5机器中安装geo django应用程序。该应用程序在Ubuntu 12.04 python 2.7、django 1.4、mapnik、tilecache和支持postgis9.1的postgresql 9.1中运行良好。但是,当我在RHEL6.5中安装相同的程序时,使用geodjango API的postgis查询无法工作。问题是 pt1 = MyModel.objects.filter(thegeom__dwithin=(the_geom, 250)).dista

我正在尝试在RHEL 6.5机器中安装geo django应用程序。该应用程序在Ubuntu 12.04 python 2.7、django 1.4、mapnik、tilecache和支持postgis9.1的postgresql 9.1中运行良好。但是,当我在RHEL6.5中安装相同的程序时,使用geodjango API的postgis查询无法工作。问题是

pt1 = MyModel.objects.filter(thegeom__dwithin=(the_geom, 250)).distance(the_geom).order_by('distance')
其中,_geom是另一个表中的几何值

pt1 = MyModel.objects.filter(thegeom__dwithin=(the_geom, 250)).distance(the_geom).order_by('distance')
执行此查询时,我遇到了一个错误

pt1 = MyModel.objects.filter(thegeom__dwithin=(the_geom, 250)).distance(the_geom).order_by('distance')
“非类型”对象没有属性“组”

pt1 = MyModel.objects.filter(thegeom__dwithin=(the_geom, 250)).distance(the_geom).order_by('distance')
回溯错误为

pt1 = MyModel.objects.filter(thegeom__dwithin=(the_geom, 250)).distance(the_geom).order_by('distance')
Traceback (most recent call last):
  File "<console>", line 2, in <module>
  File "/opt/MyApp/lib/python2.7/site-packages/django/contrib/gis/db/models/query.py", line 100, in distance
    return self._distance_attribute('distance', geom, **kwargs)
  File "/opt/MyApp/lib/python2.7/site-packages/django/contrib/gis/db/models/query.py", line 582, in _distance_attribute
    geodetic = geo_field.geodetic(connection)
  File "/opt/MyApp/lib/python2.7/site-packages/django/contrib/gis/db/models/fields.py", line 131, in geodetic
    return self.units_name(connection) in self.geodetic_units
  File "/opt/MyApp/lib/python2.7/site-packages/django/contrib/gis/db/models/fields.py", line 122, in units_name
    self._get_srid_info(connection)
  File "/opt/MyApp/lib/python2.7/site-packages/django/contrib/gis/db/models/fields.py", line 108, in _get_srid_info
    self._units, self._units_name, self._spheroid = get_srid_info(self.srid, connection)
  File "/opt/MyApp/lib/python2.7/site-packages/django/contrib/gis/db/models/fields.py", line 35, in get_srid_info
    units, units_name = sr.units
  File "/opt/MyApp/lib/python2.7/site-packages/django/contrib/gis/db/backends/base.py", line 280, in units
    return (self.linear_units, self.linear_name)
  File "/opt/MyApp/lib/python2.7/site-packages/django/contrib/gis/db/backends/base.py", line 252, in linear_units
    return m.group('unit')
    AttributeError: 'NoneType' object has no attribute 'group'

请发布更多的回溯,这个错误本身解释不了多少。@RemcoGerlich我已经添加了整个回溯错误