在Windows上的python 2.7中如何在sqlite3模块中使用/安装rtree [英] How to use/install rtree in sqlite3 module in python 2.7 on windows

查看:254
本文介绍了在Windows上的python 2.7中如何在sqlite3模块中使用/安装rtree的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试在使用contrib.gis应用程序(GeoDjango)的django项目中使用spacespaceite数据库.同步数据库时,django给出错误没有这样的模块:rtree".显然,python 2.7.3附带的sqlite3模块在sqlite数据库中不支持rtree.

I'm trying to use spatialite database with my django project that is using contrib.gis application (GeoDjango). When syncing database django gives an error "no such module: rtree". Apparently the sqlite3 module that ships with python 2.7.3 doesn't support rtree in sqlite database.

该如何解决?

推荐答案

您需要使用

SQLITE_ENABLE_RTREE

标志设置.具体操作方式取决于您的环境,但通常会添加以下内容:

flag set. How you do that depends on your environment, but typically adding something like:

-DSQLITE_ENABLE_RTREE = 1

-DSQLITE_ENABLE_RTREE=1

通常您的编译器标志就足够了.

to your compiler flags will usually be enough.

这篇关于在Windows上的python 2.7中如何在sqlite3模块中使用/安装rtree的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆