By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,276 Members | 1,951 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,276 IT Pros & Developers. It's quick & easy.

Installing PySQLite on OS X 10.4

P: n/a
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

Mar 15 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
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>

Mar 15 '06 #2

P: n/a

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?

Mar 15 '06 #3

P: n/a
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
Mar 15 '06 #4

P: n/a

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.

Mar 15 '06 #5

P: n/a
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/pysqli...ll-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
Mar 15 '06 #6

P: n/a
Cheers. I should have read the installation notes more carefully :)

Rob C

Mar 16 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.