Installing PySQLite on OS X 10.4

R

Rob Cowie

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
 
F

Fredrik Lundh

Rob said:
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>
 
R

Rob Cowie

Fredrik said:
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?
 
?

=?ISO-8859-1?Q?Gerhard_H=E4ring?=

Rob said:
[...]
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
 
R

Rob Cowie

Gerhard said:
Rob said:
[...]
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.
 
?

=?ISO-8859-1?Q?Gerhard_H=E4ring?=

Rob said:
[...]
"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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top