Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > sqlite3 and Python 2.5.1

Reply
Thread Tools

sqlite3 and Python 2.5.1

 
 
milan_sanremo
Guest
Posts: n/a
 
      06-16-2008
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?


 
Reply With Quote
 
 
 
 
Lie
Guest
Posts: n/a
 
      06-16-2008
On Jun 17, 12:59*am, milan_sanremo <(E-Mail Removed)> 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?


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.
 
Reply With Quote
 
 
 
 
Gerhard Häring
Guest
Posts: n/a
 
      06-16-2008
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
 
Reply With Quote
 
Robert Hancock
Guest
Posts: n/a
 
      06-16-2008
On Jun 16, 5:15 pm, Gerhard Häring <(E-Mail Removed)> wrote:
> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Python 2.6 and Sqlite3 - Slow bruceg113355@gmail.com Python 14 08-28-2012 10:01 PM
RE: Python, CGI and Sqlite3 Ahmed, Shakir Python 0 04-13-2010 06:54 PM
Windows XP problem with Ruby, gem sqlite3-ruby, and SQLite3 SunSw0rd Ruby 4 07-02-2009 02:08 PM
"require 'sqlite3'" gives "no such file to load -- sqlite3 (LoadError)" Jeffrey 'jf' Lim Ruby 5 04-09-2007 10:58 AM
python sqlite3 api question lolmcbride@googlemail.com Python 2 05-11-2006 06:13 AM



Advertisments