What are sqlite development headers and how to install them?
Asked Answered
C

3

12

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.

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?

Chancery answered 22/9, 2009 at 20:57 Comment(3)
Can you say what version of python you have and what platform you are on?Trachyte
Right, we can't get much further without knowing platform specifics, including OS and CLI. (Linux & which specific linux distro? Windows, but which CLI?)Attrahent
My platform: CentOS release 5.3 (Final).Chancery
A
20

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.

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.

Attrahent answered 22/9, 2009 at 21:10 Comment(4)
What platform are you on? And which CLI?Attrahent
My platform: CentOS release 5.3 (Final). I have Python-2.6.2Chancery
Aha, so you need the .rpm instead of the .deb package. Your command will be something like rpm -i sqlite3-devel-3.n.n.n.rpm. CentOS doesn't seem to coordinate packages, so you need to go hunt down an rpm, and I guess you just have to know which RHEL corresonds to which CentOS. Start here, maybe: dag.wieers.com/rpm/packages/sqliteAttrahent
For a person who dropped C++ for a decade or two and is just now picking it back up, the history lesson was very helpful!Ommatidium
G
8

For me this worked (Redhat/CentOS):

$ sudo yum install sqlite-devel

Guitarfish answered 15/4, 2011 at 0:52 Comment(0)
P
0

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.

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.

Princeling answered 22/9, 2009 at 21:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.