python 什么是 sqlite 开发头文件以及如何安装它们?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1462565/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What are sqlite development headers and how to install them?
提问by Verrtex
I am trying to install pysqlite and have troubles with that. I found out that the most probable reason of that is missing sqlite headers and I have to install them.
我正在尝试安装 pysqlite 并且遇到了麻烦。我发现最可能的原因是缺少 sqlite 头文件,我必须安装它们。
However, I have no ideas what these headers are (where I can find them, what they are doing and how to install them).
但是,我不知道这些标头是什么(在哪里可以找到它们,它们在做什么以及如何安装它们)。
Can anybody, pleas, help me with that?
任何人都可以请帮助我吗?
回答by DigitalRoss
debian/ubuntu:
Debian/Ubuntu:
$ apt-get install libsqlite3-dev # or rpm -i sqlite-devel-something.rpm
I think a number of interpreters just recompile their small connection libraries on installation, but to do that they need the C .h files in addition to the library to link against. You may already have the library, because something else depended on it, but you don't necessarily have the dev
package, which is kind of half-way between source and binary.
我认为许多解释器只是在安装时重新编译他们的小型连接库,但要做到这一点,除了要链接的库之外,他们还需要 C .h 文件。您可能已经拥有该库,因为其他东西依赖于它,但您不一定拥有该dev
包,它介于源代码和二进制文件之间。
Part of it is straightforward, if you are going to develop with a library you need its interface headers.
其中一部分很简单,如果您要使用库进行开发,则需要它的接口标头。
But I think something more happened, at first, people tried all-source and all-binary distributions, but the all-binary ones were vulnerable to dependency hell, and the all-source ones were overkill. I think now that an interesting compromise is in use, a semi-source distribution where a program links to installed libraries by recompiling those parts of it that link to extension libraries. This makes a lot of sense with interpreters where most of the system can arrive in binary but the extension modules are dynamically loaded and compiled for the installed system. I think.
但我认为发生了更多的事情,起初,人们尝试了全源和全二进制发行版,但全二进制发行版容易受到依赖地狱的影响,而全源发行版则矫枉过正。我认为现在正在使用一个有趣的折衷方案,一种半源代码分发,其中程序通过重新编译链接到扩展库的那些部分来链接到已安装的库。这对于解释器很有意义,其中大部分系统可以以二进制形式到达,但扩展模块是为已安装的系统动态加载和编译的。我认为。
回答by rogerdpack
For me this worked (Redhat/CentOS):
对我来说这是有效的(Redhat/CentOS):
$ sudo yum install sqlite-devel
$ sudo yum install sqlite-devel
回答by mjv
pysqlite needs to compiled/build before you can use it. This requires C language header files (*.H) which come with the source code of sqllite itself.
pysqlite 需要编译/构建才能使用它。这需要 sqllite 本身的源代码附带的 C 语言头文件 (*.H)。
i.e. sqllite and pysqlite are two different things. Did you install sqlite prior to trying and build pysqllte ? (or maybe you did, but did you do so just with the binaries; you need the source package (or at least its headers) for pysqlite purposes.
即 sqllite 和 pysqlite 是两个不同的东西。您是否在尝试构建 pysqllte 之前安装了 sqlite?(或者也许你做了,但你是否只使用二进制文件;你需要源包(或至少它的头文件)用于 pysqlite 目的。