By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,168 Members | 1,178 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,168 IT Pros & Developers. It's quick & easy.

Using SQLite3 with python 2.5 beta

P: n/a
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?

Jun 23 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Harold Shore <hs****@1st-spot.net> writes:
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.
import sqlite3
sqlite3.sqlite_version

'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
Jun 23 '06 #2

P: n/a
Harold Shore wrote:
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>

Jun 23 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.