473,799 Members | 2,837 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sqlite3 and Python 2.5.1

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) [C] on sunos5
Type "help", "copyright" , "credits" or "license" for more information.
>>import sqlite3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named sqlite3
>>>
Yet:

# find /usr/local/python -name "sqlite*" -print
/usr/local/python/lib/python2.5/sqlite3

# /opt/csw/bin/sqlite3
SQLite version 3.2.2
Enter ".help" for instructions
sqlite>

What is missing?
Jun 27 '08 #1
3 2975
Lie
On Jun 17, 12:59*am, milan_sanremo <hancock.rob... @gmail.comwrote :
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) [C] on sunos5
Type "help", "copyright" , "credits" or "license" for more information.
>>import sqlite3

Traceback (most recent call last):
* File "<stdin>", line 1, in <module>
ImportError: No module named sqlite3

Yet:

# find /usr/local/python -name "sqlite*" -print
/usr/local/python/lib/python2.5/sqlite3

# /opt/csw/bin/sqlite3
SQLite version 3.2.2
Enter ".help" for instructions
sqlite>

What is missing?
Did you, by chance, happened to compile your Python yourself? From
what I see here:
http://www.megasolutions.net/python/...te3-78710.aspx
Python's source doesn't include the sqlite3 source, it only contains
pysqlite interface, so when compiling python you need to get sqlite3
too.
Jun 27 '08 #2
milan_sanremo wrote:
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) [C] on sunos5
Type "help", "copyright" , "credits" or "license" for more information.
>>>import sqlite3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named sqlite3

Yet:

# find /usr/local/python -name "sqlite*" -print
/usr/local/python/lib/python2.5/sqlite3

# /opt/csw/bin/sqlite3
SQLite version 3.2.2
Enter ".help" for instructions
sqlite>

What is missing?
You compiled Python yourself. During that, the SQLite3 header files
could not be found, so the sqlite3 module was not compiled/installed.

-- Gerhard
Jun 27 '08 #3
On Jun 16, 5:15 pm, Gerhard Häring <g...@ghaering. dewrote:
milan_sanremo wrote:
I have sqlite installed, but when I try to importsqlite3I receive:
Python 2.5.1 (r251:54863, Nov 3 2007, 02:54:36) [C] on sunos5
Type "help", "copyright" , "credits" or "license" for more information.
>>importsqlit e3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module namedsqlite3
Yet:
# find /usr/local/python -name "sqlite*" -print
/usr/local/python/lib/python2.5/sqlite3
# /opt/csw/bin/sqlite3
SQLite version 3.2.2
Enter ".help" for instructions
sqlite>
What is missing?

You compiled Python yourself. During that, theSQLite3heade r files
could not be found, so thesqlite3modul e was not compiled/installed.

-- Gerhard
Thanks, I'll recompile.
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3628
by: Harold Shore | last post by:
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
2
1976
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 new ...": """ # Create table c.execute('''create table stocks (date timestamp, trans varchar, symbol varchar, qty decimal, price decimal)''')
2
4954
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 = sqlite3.connect(':memory:') conn.execute("create table foo (a int,b int)") conn.execute('create view bar as select * from foo')
6
3235
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 is 1, so when I do; .... print s .... (1, u'Spikedrivers Blues', u'Mississippi John Hurt')
4
8926
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. However, when I start python and do an import sqlite3 I get: /ptmp/bin/python Python 2.5.1 (r251:54863, May 29 2007, 05:19:30) on sunos5
0
1456
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. It is stripped and thus cannot be relocated. This causes the following exception on computers where something is already loaded into the address the sqlite3.dll wants to use: File "sqlite3\__init__.pyc", line 24, in <module> File...
0
4109
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 calls. The relevant source code is here if you're interested: http://svn.python.org/projects/python/trunk/Modules/_sqlite/cursor.c
0
1765
by: Ben Lee | last post by:
hi folks -- a quick python and sqlite3 performance question. i find that inserting a million rows of in-memory data into an in-memory database via a single executemany() is about 30% slower than using the sqlite3 CLI and the .import command (reading the same data from a disk file, even.) i find this surprising, executemany() i assume is using a prepared statement and this is exactly what the .import command does (based on my quick...
15
14791
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 directory". So, I assume that the absence of the "sqlite3.h" is the origin of the problem. I found on the web, that this file should be either in "/usr/local/ include" or in "/usr/local/lib". I check this directories and I really
0
9541
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10482
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10225
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10027
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6805
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4139
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.