Using SQLite3 with python 2.5 beta

H

Harold Shore

From the release notes I read that

"If you're compiling the Python source yourself, note that
the source tree doesn't include the SQLite code, only the
wrapper module. You'll need to have the SQLite libraries
and headers installed before compiling Python, and the build
process will compile the module when the necessary headers
are available."

I do have SQLite3 installed on my system, but after doing a
plain vanilla compilation of the the 2.5 beta and trying
the SQLite code given in the release notes I get the message
"NameError: name 'sqlite3' is not defined".

I wonder what the requirement means that "when the necessary
headers are available"? How would they need to be made
available?

Does anyone have any success with this?
 
T

Tim Heaney

Harold Shore said:
From the release notes I read that

"If you're compiling the Python source yourself, note that
the source tree doesn't include the SQLite code, only the
wrapper module. You'll need to have the SQLite libraries
and headers installed before compiling Python, and the build
process will compile the module when the necessary headers
are available."

I do have SQLite3 installed on my system, but after doing a
plain vanilla compilation of the the 2.5 beta and trying
the SQLite code given in the release notes I get the message
"NameError: name 'sqlite3' is not defined".

I wonder what the requirement means that "when the necessary
headers are available"? How would they need to be made
available?

Does anyone have any success with this?

It seems to work okay for me.

$ python2.5
Python 2.5b1 (r25b1:47027, Jun 21 2006, 19:41:51)
[GCC 4.0.2 20051125 (Red Hat 4.0.2-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information. '3.1.2'

On my system, the header file is

/usr/include/sqlite3.h

and the library file is

/usr/lib64/libsqlite3.so

Those are both standard locations, so configure found them on its
own. If they are someplace unusual, you'll have to tell configure
where they are. It's possible you have SQLite3 installed, but you lack
the header. My system uses RPM, so I had to install both sqlite
and sqlite-devel before building Python. The sqlite-devel package
contains the header.

I hope this helps,

Tim
 
F

Fredrik Lundh

Harold said:
I do have SQLite3 installed on my system, but after doing a
plain vanilla compilation of the the 2.5 beta and trying
the SQLite code given in the release notes I get the message
"NameError: name 'sqlite3' is not defined".

I wonder what the requirement means that "when the necessary
headers are available"? How would they need to be made
available?

if you're installing from RPM:s (or similar), look for -dev or -devel
packages.

most package providers distinguish between runtime files (required to
run a prebuilt program that's been linked against a specific library)
and development files (required to actually build such a program).

</F>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top