mysql数据库与geodjango [英] geodjango with mysql database
问题描述
我正在使用geodjango开发应用程序,并且遇到了一些困难。遵循django官方网站 https://docs.djangoproject.com/en/1.11/ref/contrib/gis/tutorial/#use-ogrinfo-to-examine-spatial-data 。我首先使用 orginfo
来检查收到失败消息的空间数据
I am developing an application with geodjango and I have been running into some difficulties. following the procedures on the official django website https://docs.djangoproject.com/en/1.11/ref/contrib/gis/tutorial/#use-ogrinfo-to-examine-spatial-data . I first used the orginfo
to check spatial data I got a failed message
FAILURE:
Unable to open datasource `world/data/TM_WORLD_BORDERS-0.3.shp' with the following drivers.
然后,我按照剩下的过程创建模型,而我进行迁移时遇到的错误是
then I followed the remaining process creating the models and the error I got when I ran migration was
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/Users/Olar/Desktop/arbithub/lib/python2.7/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
utility.execute()
File "/Users/Olar/Desktop/arbithub/lib/python2.7/site-packages/django/core/management/__init__.py", line 337, in execute
django.setup()
File "/Users/Olar/Desktop/arbithub/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/Olar/Desktop/arbithub/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
app_config.import_models()
File "/Users/Olar/Desktop/arbithub/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models
self.models_module = import_module(models_module_name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/Users/Olar/Desktop/arbithub/src/geolocation/models.py", line 5, in <module>
from django.contrib.gis.db import models
File "/Users/Olar/Desktop/arbithub/lib/python2.7/site-packages/django/contrib/gis/db/models/__init__.py", line 3, in <module>
from django.contrib.gis.db.models.aggregates import * # NOQA
File "/Users/Olar/Desktop/arbithub/lib/python2.7/site-packages/django/contrib/gis/db/models/aggregates.py", line 1, in <module>
from django.contrib.gis.db.models.fields import ExtentField
File "/Users/Olar/Desktop/arbithub/lib/python2.7/site-packages/django/contrib/gis/db/models/fields.py", line 3, in <module>
from django.contrib.gis import forms, gdal
File "/Users/Olar/Desktop/arbithub/lib/python2.7/site-packages/django/contrib/gis/forms/__init__.py", line 3, in <module>
from .fields import ( # NOQA
File "/Users/Olar/Desktop/arbithub/lib/python2.7/site-packages/django/contrib/gis/forms/fields.py", line 4, in <module>
from django.contrib.gis.geos import GEOSException, GEOSGeometry
File "/Users/Olar/Desktop/arbithub/lib/python2.7/site-packages/django/contrib/gis/geos/__init__.py", line 18, in <module>
HAS_GEOS = geos_version_info()['version'] >= '3.3.0'
File "/Users/Olar/Desktop/arbithub/lib/python2.7/site-packages/django/contrib/gis/geos/libgeos.py", line 196, in geos_version_info
raise GEOSException('Could not parse version info string "%s"' % ver)
django.contrib.gis.geos.error.GEOSException: Could not parse version info string "3.6.2-CAPI-1.10.2 4d2925d6"
根据要求可以提供其他代码。请提供帮助
further codes would b supplied based on request. Kindly help with it
推荐答案
无法解析版本信息字符串错误是机票28441 中的问题,该问题已在Django 1.11.5中修复。
The Could not parse version info string error is the issue in ticket 28441, which has been fixed in Django 1.11.5.
请注意,使用最新的发行版(当前针对1.11.X为1.11.5)始终是一个好主意,以确保您拥有最新的安全补丁程序和错误修复程序。
Note that it's always a good idea to use the latest point release (currently 1.11.5 for 1.11.X) to make sure you've got the latest security patches and bug fixes.
这篇关于mysql数据库与geodjango的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!