小编Dan*_*iel的帖子

GIS/Gdal/OSGeos在Windows上的django中导入错误

我现在几个小时都在尝试这个,但我无法解决它.我正在使用链接在Windows上设置GeoDjango.我收到以下错误消息,我不知道该怎么做.所有环境变量都在Windows中设置,我可以导入

来自osgeo import gdal

在python终端成功

导入gdal

已弃用.在Postgresql数据库中,我根据需要提供所有扩展,如address_standardizer,fuzzystrmatch,ogr_fdw,pgrouting,plpgsql,pointcloud,pointcloud_postgis,postgis,postgis_sfcgal,postgis_tiger_geocoderpostgis_topology.

Django项目设置:

DATABASES = {
    'default': {
        'ENGINE': 'django.contrib.gis.db.backends.postgis',
        'NAME': 'postgis_24_sample',
        'USER': 'postgres',
        'PASSWORD': 'Hello123',
        'HOST': 'localhost',
        'PORT': '',
    }
}

GDAL_LIBRARY_PATH = os.getenv('GDAL_LIBRARY_PATH')
GEOS_LIBRARY_PATH = os.getenv('GEOS_LIBRARY_PATH')

INSTALLED_APPS = [
    ...
    'django.contrib.postgis',
    ...
]
Run Code Online (Sandbox Code Playgroud)

错误:

(easy_geodj) C:\Users\dell\Desktop\easy_geodj\easy_geodj\djlocate>python manage.py runserver
Unhandled exception in thread started by <function wrapper at 0x066D6330>
Traceback …
Run Code Online (Sandbox Code Playgroud)

python django postgis geospatial geodjango

7
推荐指数
1
解决办法
1142
查看次数

标签 统计

django ×1

geodjango ×1

geospatial ×1

postgis ×1

python ×1