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

sqlite3 and Python 2.5.1

P: n/a
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
Share this Question
Share on Google+
3 Replies


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

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

P: n/a
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.
>>importsqlite3
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, theSQLite3header files
could not be found, so thesqlite3module was not compiled/installed.

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

This discussion thread is closed

Replies have been disabled for this discussion.