Mac OSX sqlite problem. Missing?

R

ricardo.turpino

Hi,

I've installed Mac Python 2.5. I'm running Mac OS X 10.4.10 on a
Macbook 1.83GHz. I though that the python sqlite library was
installed by default as part of Mac Python 2.5, however, I still have
a problem.

Sqlite does not appear to be my system:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named sqlite

I ran 'sudo easy_install pysqlite' which gave me the file
'pysqlite-2.3.5-py2.5-macosx-10.3-fat.egg', but no working pysqlite.

I then downloaded the source files and ran 'python ez_setup.py
pysqlite==2.3.5', which told me 'Using /Library/Frameworks/
Python.framework/Versions/2.5/lib/python2.5/site-packages/
pysqlite-2.3.5-py2.5-macosx-10.3-fat.egg'

Still no working version of pysqlite.

Tried installing from source. No problems appeared, but I still can't
use pysqlite.

The reason I am trying to install pysqlite, is to use turbogears,
which initially failed when I ran 'tg-admin sql create', it failed
with 'import sqlite. ImportError: No module named sqlite'.

Any ideas gratefully received.

Thanks.
 
D

Diez B. Roggisch

Hi,

I've installed Mac Python 2.5. I'm running Mac OS X 10.4.10 on a
Macbook 1.83GHz. I though that the python sqlite library was
installed by default as part of Mac Python 2.5, however, I still have
a problem.

Sqlite does not appear to be my system:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named sqlite

I ran 'sudo easy_install pysqlite' which gave me the file
'pysqlite-2.3.5-py2.5-macosx-10.3-fat.egg', but no working pysqlite.

I then downloaded the source files and ran 'python ez_setup.py
pysqlite==2.3.5', which told me 'Using /Library/Frameworks/
Python.framework/Versions/2.5/lib/python2.5/site-packages/
pysqlite-2.3.5-py2.5-macosx-10.3-fat.egg'

Still no working version of pysqlite.

Tried installing from source. No problems appeared, but I still can't
use pysqlite.

The reason I am trying to install pysqlite, is to use turbogears,
which initially failed when I ran 'tg-admin sql create', it failed
with 'import sqlite. ImportError: No module named sqlite'.

Any ideas gratefully received.

Are you by any chance using the python 2.3 when issuing that import
statement?

Diez
 
R

ricardo.turpino

Diez said:
Are you by any chance using the python 2.3 when issuing that import
statement?

Diez

Unfortunately not :(

ibook:~/project1$ python -V
Python 2.5
ibook:~/project1$ python
Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
Type "help", "copyright", "credits" or "license" for more information.Traceback (most recent call last):
 
A

attn.steven.kuo

Diez said:
Are you by any chance using the python 2.3 when issuing that import
statement?

Unfortunately not :(

ibook:~/project1$ python -V
Python 2.5
ibook:~/project1$ python
Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
Type "help", "copyright", "credits" or "license" for more information.>>> import sqlite

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named sqlite




Isn't it sqlite3 (instead of sqlite)?

Python 2.5.1c1 (r251c1:54692, Apr 17 2007, 21:12:16)
[GCC 4.0.0 (Apple Computer, Inc. build 5026)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

I also see it under that name in the repository:

http://svn.python.org/view/python/trunk/Lib/sqlite3/
 
S

scottishguy

Diez B. Roggisch wrote:
Unfortunately not :(
ibook:~/project1$ python -V
Python 2.5
ibook:~/project1$ python
Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
Type "help", "copyright", "credits" or "license" for more information.>>> import sqlite
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named sqlite

Isn't it sqlite3 (instead of sqlite)?

Python 2.5.1c1 (r251c1:54692, Apr 17 2007, 21:12:16)
[GCC 4.0.0 (Apple Computer, Inc. build 5026)] on darwin
Type "help", "copyright", "credits" or "license" for more information.>>> import sqlite3
<type 'sqlite3.Connection'>>>> sqlite3.Connection.__doc__

'SQLite database connection object.'



I also see it under that name in the repository:

http://svn.python.org/view/python/trunk/Lib/sqlite3/

The problem is that the user is trying to install the turbogears
framework, and 'tg-admin' tries to import sqlite (not sqlite3)

He's getting this error:
'import sqlite. ImportError: No module named sqlite'.

Without changing the turbogears code, what should he do? Set up a
symbolic link from 'sqlite3' to 'sqlite' ?
 
S

Steve Holden

scottishguy said:
Diez B. Roggisch wrote:
Are you by any chance using the python 2.3 when issuing that import
statement?
Diez
Unfortunately not :(
ibook:~/project1$ python -V
Python 2.5
ibook:~/project1$ python
Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
Type "help", "copyright", "credits" or "license" for more information.>>> import sqlite
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named sqlite
Isn't it sqlite3 (instead of sqlite)?

Python 2.5.1c1 (r251c1:54692, Apr 17 2007, 21:12:16)
[GCC 4.0.0 (Apple Computer, Inc. build 5026)] on darwin
Type "help", "copyright", "credits" or "license" for more information.>>> import sqlite3
sqlite3.Connection
<type 'sqlite3.Connection'>>>> sqlite3.Connection.__doc__

'SQLite database connection object.'



I also see it under that name in the repository:

http://svn.python.org/view/python/trunk/Lib/sqlite3/

The problem is that the user is trying to install the turbogears
framework, and 'tg-admin' tries to import sqlite (not sqlite3)

He's getting this error:
'import sqlite. ImportError: No module named sqlite'.

Without changing the turbogears code, what should he do? Set up a
symbolic link from 'sqlite3' to 'sqlite' ?
An alternative would be to create a local sqlite.py (importable by tg)
containing

from sqlite3 import *

though this may not work with an extension module if namespace tricks
are invoked.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------
 

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

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top