Using SQLite3 with python 2.5 beta

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Harold Shore

    #1

    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?

  • Tim Heaney

    #2
    Re: Using SQLite3 with python 2.5 beta

    Harold Shore <hshore@1st-spot.net> writes:
    [color=blue]
    > 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?[/color]

    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.[color=blue][color=green][color=darkred]
    >>> import sqlite3
    >>> sqlite3.sqlite_ version[/color][/color][/color]
    '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

    Comment

    • Fredrik Lundh

      #3
      Re: Using SQLite3 with python 2.5 beta

      Harold Shore wrote:
      [color=blue]
      > 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?[/color]

      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>

      Comment

      Working...