473,466 Members | 1,363 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using SQLite3 with python 2.5 beta

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
2 3610
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: John Machin | last post by:
Apologies in advance if this is a bit bloggy, but I'd like to get comments on whether I've lost the plot (or, more likely, failed to acquire it) before I start reporting bugs etc. From "What's...
2
by: Josh | last post by:
Hi, I'm running into a problem when trying to create a view in my sqlite database in python. I think its a bug in the sqlite3 api that comes with python 2.5. This works as expected: conn =...
6
by: Jorgen Bodde | last post by:
Hi all, I am using sqlite3 in python, and I wonder if there is a way to know if there are valid rows returned or not. For example I have a table song with one entry in it. The ID of that entry...
4
by: Simon | last post by:
I installed the source code on unix for python 2.5.1. The install went mainly okay, except for some failures regarding: _ssl, _hashlib, _curses, _curses_panel. No errors regarding sqlite3....
0
by: Josh Ritter | last post by:
A number of our Windows customers have an issue with the sqlite3 module included with Python 2.5.1 We've tracked the problem down to the sqlite3.dll included with the Python 2.5.1 distrubtion. ...
2
by: Victor Lin | last post by:
Now I am now developing a program that base on sqlite3 in python. But there is a strange problem. That is, all data I insert into sqlite database do not goes into file in disk. It is really...
0
by: David | last post by:
- Are there any peculiarities with using curs.executemany(...) vs. multiple How many times are you calling execute vs a single executemany? The python call overhead will add up for thousands of...
3
by: milan_sanremo | last post by:
I have sqlite installed, but when I try to import sqlite3 I receive: Python 2.5.1 (r251:54863, Nov 3 2007, 02:54:36) on sunos5 Type "help", "copyright", "credits" or "license" for more...
15
by: Kurda Yon | last post by:
Hi, I try to "build" and "install" pysqlite? After I type "python setup.py build" I get a lot of error messages? The first error is "src/ connection.h:33:21: error: sqlite3.h: No such file or...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.