FAQ
Hi all,

I'm having difficulty installing pysqlite 2.1.3 on Mac OS X 10.4.4

There are some notes on the pysqlite wiki regarding modification of the
setup.py script and I've followed them to no avail.

Build and install appear to go smoothly but attempting to run the tests
from the python interpreter fails. Likewise any attempt to utilise
pysqlite2 in a python script fails.

Has anyone here successfully installed it?

If you have, do you have any pearls of wisdom that might help me out?

Cheers,

Rob C

Search Discussions

  • Fredrik Lundh at Mar 15, 2006 at 1:00 pm

    Rob Cowie wrote:

    There are some notes on the pysqlite wiki regarding modification of the
    setup.py script and I've followed them to no avail.

    Build and install appear to go smoothly but attempting to run the tests
    from the python interpreter fails. Likewise any attempt to utilise
    pysqlite2 in a python script fails.
    it's might be a bit easier to help if you what you did when attempting to use
    the library, and how things failed.

    (if you get an ImportError, are you importing the right thing? where did the
    "setup.py install" step put the modules ? is that directory on the Python path ?)

    </F>
  • Rob Cowie at Mar 15, 2006 at 2:15 pm

    Fredrik Lundh wrote:
    Rob Cowie wrote:
    There are some notes on the pysqlite wiki regarding modification of the
    setup.py script and I've followed them to no avail.

    Build and install appear to go smoothly but attempting to run the tests
    from the python interpreter fails. Likewise any attempt to utilise
    pysqlite2 in a python script fails.
    it's might be a bit easier to help if you what you did when attempting to use
    the library, and how things failed.

    (if you get an ImportError, are you importing the right thing? where did the
    "setup.py install" step put the modules ? is that directory on the Python path ?)

    </F>
    True... I should have included this stuff.

    the output from "setup.py install" indicates that an egg is constructed
    and copied to
    "/Library/Python/2.3/site-packages/pysqlite-2.1.3-py2.3-macosx-10.4-ppc.egg".

    At the python prompt, I can "import pysqlite2" with no problems.

    However, if I do "from pysqlite2 import test" as suggested after
    installation, I get the following traceback...

    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "pysqlite2/test/__init__.py", line 25, in ?
    from pysqlite2.test import dbapi, types, userfunctions, factory,
    transactions
    File "pysqlite2/test/dbapi.py", line 26, in ?
    import pysqlite2.dbapi2 as sqlite
    File "pysqlite2/dbapi2.py", line 32, in ?
    from pysqlite2._sqlite import *
    ImportError: No module named _sqlite

    If I view my site-packages dir in the Finder, the .egg file appears as
    a document, instead of a directory as is usually the case with .eggs.
    Perhaps this is an indication that the .egg file is not being built
    correctly?
  • Gerhard Häring at Mar 15, 2006 at 3:18 pm

    Rob Cowie wrote:
    [...]
    However, if I do "from pysqlite2 import test" as suggested after
    installation, I get the following traceback...

    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "pysqlite2/test/__init__.py", line 25, in ?
    from pysqlite2.test import dbapi, types, userfunctions, factory,
    transactions
    File "pysqlite2/test/dbapi.py", line 26, in ?
    import pysqlite2.dbapi2 as sqlite
    File "pysqlite2/dbapi2.py", line 32, in ?
    from pysqlite2._sqlite import *
    ImportError: No module named _sqlite
    [...]
    Apparently, you're doing this from the pysqlite sources root directory.
    So the pysqlite2 directory is tried, which does ont include the compiled
    C extension module. Execuring from any other working directory on your
    system should work fine.

    I'll have to check that this is all properly documented before I do the
    next pysqlite release.

    -- Gerhard
  • Rob Cowie at Mar 15, 2006 at 3:48 pm

    Gerhard H?ring wrote:
    Rob Cowie wrote:
    [...]
    However, if I do "from pysqlite2 import test" as suggested after
    installation, I get the following traceback...

    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "pysqlite2/test/__init__.py", line 25, in ?
    from pysqlite2.test import dbapi, types, userfunctions, factory,
    transactions
    File "pysqlite2/test/dbapi.py", line 26, in ?
    import pysqlite2.dbapi2 as sqlite
    File "pysqlite2/dbapi2.py", line 32, in ?
    from pysqlite2._sqlite import *
    ImportError: No module named _sqlite
    [...]
    Apparently, you're doing this from the pysqlite sources root directory.
    So the pysqlite2 directory is tried, which does ont include the compiled
    C extension module. Execuring from any other working directory on your
    system should work fine.

    I'll have to check that this is all properly documented before I do the
    next pysqlite release.

    -- Gerhard
    Thanks.... however, now when I try "from pysqlite2 import test" it
    results in:

    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File
    "build/bdist.darwin-8.5.0-Power_Macintosh/egg/pysqlite2/test/__init__.py",
    line 25, in ?
    File
    "build/bdist.darwin-8.5.0-Power_Macintosh/egg/pysqlite2/test/dbapi.py",
    line 26, in ?
    File
    "build/bdist.darwin-8.5.0-Power_Macintosh/egg/pysqlite2/dbapi2.py",
    line 32, in ?
    File
    "build/bdist.darwin-8.5.0-Power_Macintosh/egg/pysqlite2/_sqlite.py",
    line 7, in ?
    File
    "build/bdist.darwin-8.5.0-Power_Macintosh/egg/pysqlite2/_sqlite.py",
    line 6, in __bootstrap__
    ImportError:
    dlopen(/Users/rob/.python-eggs/pysqlite-2.1.3-py2.3-macosx-10.4-ppc.egg-tmp/pysqlite2/_sqlite.so,
    2): Symbol not found: _sqlite3_transfer_bindings
    Referenced from:
    /Users/rob/.python-eggs/pysqlite-2.1.3-py2.3-macosx-10.4-ppc.egg-tmp/pysqlite2/_sqlite.so
    Expected in: dynamic lookup

    I now suspect that this may all be down to the version of sqlite3
    installed as part of OS X 10.4. Some people report success when using
    this version with pysqlite, others report failure.
  • Gerhard Häring at Mar 15, 2006 at 4:08 pm

    Rob Cowie wrote:
    [...]
    "build/bdist.darwin-8.5.0-Power_Macintosh/egg/pysqlite2/_sqlite.py",
    line 6, in __bootstrap__
    ImportError:
    dlopen(/Users/rob/.python-eggs/pysqlite-2.1.3-py2.3-macosx-10.4-ppc.egg-tmp/pysqlite2/_sqlite.so,
    2): Symbol not found: _sqlite3_transfer_bindings
    Referenced from:
    /Users/rob/.python-eggs/pysqlite-2.1.3-py2.3-macosx-10.4-ppc.egg-tmp/pysqlite2/_sqlite.so
    Expected in: dynamic lookup

    I now suspect that this may all be down to the version of sqlite3
    installed as part of OS X 10.4. Some people report success when using
    this version with pysqlite, others report failure.
    Quoting http://initd.org/pub/software/pysqlite/doc/install-source.html

    """
    SQLite:
    * SQLite version 3.2.2 or later (as of pysqlite 2.1.0).
    """

    You'll need to install a more recent SQLite version than the one shipped
    with OS X 10.4.

    Alternatively, you could use pysqlite 2.0.7, which has less cool
    features, but works with your SQLite version. If you plan to stick to
    the DB-API and not use convenience features introduced in pysqlite 2.1
    it doesn't make any difference.

    -- Gerhard
  • Rob Cowie at Mar 16, 2006 at 9:41 am
    Cheers. I should have read the installation notes more carefully :)

    Rob C

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedMar 15, '06 at 12:53p
activeMar 16, '06 at 9:41a
posts7
users3
websitepython.org

People

Translate

site design / logo © 2022 Grokbase