471,320 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,320 software developers and data experts.

Mac OSX sqlite problem. Missing?

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:
>>import sqlite
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.

Sep 10 '07 #1
3 3423
ri*************@gmail.com schrieb:
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:
>>>import sqlite
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
Sep 10 '07 #2
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
>>>
Sep 10 '07 #3
On Sep 10, 1:51 pm, ricardo.turp...@gmail.com wrote:
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/

--
Hope this helps,
Steven

Sep 11 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.