在 Windows 上编译 pysqlite 时遇到问题 [英] Having trouble compiling pysqlite on windows

查看:43
本文介绍了在 Windows 上编译 pysqlite 时遇到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天.

我在 Windows 上编译 pysqlite 时遇到问题.我已经设法通过大量工作开始编译,但现在我遇到了这个错误:

I am having trouble compiling pysqlite on windows. I have managed to start compiling with quite a bit of work but now I am stuck with this error:

d:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe:找不到-lsqlite3

d:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: cannot find -lsqlite3

我已经搜索了可能的解决方案,但大多数解决方案都适用于 linux.

I have searched for possible solutions but most of the solutions are for linux.

请帮忙.

谢谢.

推荐答案

从源代码编译 pysqlite2 时,您需要编辑文件 setup.cfg,默认情况下应该看起来像:

when compiling pysqlite2 from source, you need to edit the file setup.cfg which by default should look like:

[build_ext]
#define=
#include_dirs=/usr/local/include
#library_dirs=/usr/local/lib
libraries=sqlite3
define=SQLITE_OMIT_LOAD_EXTENSION

您需要取消注释 include_dirslibrary_dirs(删除 #)并确保 include_dirs 点到带有 sqlite3 头文件的目录,以及 library_dirs 到可以找到 sqlite3.dll 的位置.

You'll need to uncomment include_dirs and library_dirs (remove the #) an make sure include_dirs points to the directory with the sqlite3 headers, and library_dirs to where sqlite3.dll can be found.

现在你应该可以编译和安装pysqlite2了.之后,您应该将 sqlite3.dll 放在可以找到它的地方(在 PATH 上的某个位置,或到 Python27\Lib\site-packages\pysqlite2)

Now you should be able to compile and install pysqlite2. After that, you should put sqlite3.dll somwhere it can be found (either somewhere on the PATH, or into Python27\Lib\site-packages\pysqlite2)

这篇关于在 Windows 上编译 pysqlite 时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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