sqlite3 and Python 2.5.1

Discussion in 'Python' started by milan_sanremo, Jun 16, 2008.

  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?
    milan_sanremo, Jun 16, 2008
    #1
    1. Advertising

  2. milan_sanremo

    Lie Guest

    On Jun 17, 12:59 am, 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?


    Did you, by chance, happened to compile your Python yourself? From
    what I see here:
    http://www.megasolutions.net/python/python-unix-install,-sqlite3-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.
    Lie, Jun 16, 2008
    #2
    1. Advertising

  3. 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
    Gerhard Häring, Jun 16, 2008
    #3
  4. On Jun 16, 5:15 pm, Gerhard Häring <> 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.
    Robert Hancock, Jun 17, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    443
  2. Ahmed, Shakir

    RE: Python, CGI and Sqlite3

    Ahmed, Shakir, Apr 13, 2010, in forum: Python
    Replies:
    0
    Views:
    575
    Ahmed, Shakir
    Apr 13, 2010
  3. Jeffrey 'jf' Lim
    Replies:
    5
    Views:
    485
    Jeffrey 'jf' Lim
    Apr 9, 2007
  4. SunSw0rd
    Replies:
    4
    Views:
    257
    SunSw0rd
    Jul 2, 2009
  5. Replies:
    14
    Views:
    455
    Pedro Larroy
    Aug 28, 2012
Loading...

Share This Page