我怎样才能在Python 2.6升级包sqlite3的? [英] How can I upgrade the sqlite3 package in Python 2.6?

查看:128
本文介绍了我怎样才能在Python 2.6升级包sqlite3的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是用Python 2.6.5建立我的应用程序,它附带的sqlite3 3.5.9。不过很显然,正如我在我的另一个问题发现了,外键的支持不是在sqlite3的出台,直到3.6.19版本。然而,Python 2.7版自带的sqlite3 3.6.21,所以这项工作 - 我决定我想在我的应用程序中使用外键,所以我试图升级到Python 2.7

I was using Python 2.6.5 to build my application, which came with sqlite3 3.5.9. Apparently though, as I found out in another question of mine, foreign key support wasn't introduced in sqlite3 until version 3.6.19. However, Python 2.7 comes with sqlite3 3.6.21, so this work -- I decided I wanted to use foreign keys in my application, so I tried upgrading to python 2.7.

我使用的是扭曲的,我不能为我的生命得到它来构建。扭曲的依赖zope.interface,我不能为Python 2.7找zope.interface - 我想这可能只是工作无论如何,但我不得不刚才的所有文件拷贝过来自己,一切工作正常我自己,而不是仅仅使用自安装包。

I'm using twisted, and I couldn't for the life of me get it to build. Twisted relies on zope.interface and I can't find zope.interface for python 2.7 -- I thought it might just "work" anyway, but I'd have to just copy all the files over myself, and get everything working myself, rather than just using the self-installing packages.

所以,我想这可能是明智的只是重新构建Python 2.6,并将其链接对sqlite3的一个新版本。但我不知道如何 -

So I thought it might be wiser to just re-build python 2.6 and link it against a new version of sqlite3. But I don't know how--

我将如何做到这一点?

我的Visual Studio 2008作为一个编译器安装,我读到的是真正支持Windows的唯一一个,我正在运行64位操作系统

I have Visual Studio 2008 installed as a compiler, I read that that is the only one that is really supported for Windows, and I am running a 64 bit operating system

推荐答案

sqlite3的是不是一个内置的模块;这是一个扩展模块(二进制为C:\\ Python26 \\ DLLs_sqlite3.pyd(我的机器上))。一个PYD是一个不同的文件扩展名,只有1入口点的DLL。还有一个sqlite3.dll,其中包含了SQLite的code。 python.exe是不是对任何这些挂钩,从而重建python.exe有没有意义。

sqlite3 is not a built-in module; it's an extension module (the binary is C:\Python26\DLLs_sqlite3.pyd (on my machine)). A pyd is a DLL with a different filename extension and only 1 entry point. There's also a sqlite3.dll, which contains the SQLite code. python.exe is not linked against either of those, and thus rebuilding python.exe has no point.

接下来的想法是要去pysqlite2下载网站,并获取最新的Windows安装程序的Python 2.6。不幸的是有没有文档哪个的SQLite版本包含;一个人需要安装它,然后渣土一下:

The next idea is to go to the pysqlite2 download site, and get the latest Windows installer for Python 2.6. Unfortunately there's no docs about which version of SQLite it contains; one needs to install it and then muck about:

>>> import sqlite3 as standard
>>> from pysqlite2 import dbapi2 as latest
>>> for m in (standard, latest):
...    print m.sqlite_version
...
3.5.9
3.6.2
>>>

所以,它仅包含SQLite的版本3.6.2,它没有你想要的真正的外键的支持。

So, it contains only SQLite version 3.6.2, which doesn't have the real foreign key support that you want.

我建议你检查href=\"http://groups.google.com/group/python-sqlite?pli=1\" rel=\"nofollow\">邮件列表,看是否

I suggest that you check the mailing list to see if your question is answered there, and if not ask about the possibility of a Python 2.6 installer containing a later SQLite (e.g. the one included with Python 2.7).

这篇关于我怎样才能在Python 2.6升级包sqlite3的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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