Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 211952

Summary: dev-lang/python-2.5.1-r5: show error when I import sqlite3 module
Product: Gentoo Linux Reporter: Foad Nosrati Habibi <foad.nh>
Component: [OLD] DevelopmentAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: VERIFIED INVALID    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
URL: http://www.unknown-boy.com/GCBot/bugs/gentoo-python-2.5.1-r5
Whiteboard:
Package list:
Runtime testing required: ---

Description Foad Nosrati Habibi 2008-03-01 09:02:47 UTC
I use "import sqlite3" in my program, but when I run it show this error:
$ python gcbot.py
Traceback (most recent call last):
  File "gcbot.py", line 39, in <module>
    import sqlite3
  File "/usr/lib/python2.5/sqlite3/__init__.py", line 24, in <module>
    from dbapi2 import *
  File "/usr/lib/python2.5/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ImportError: No module named _sqlite3

Reproducible: Always

Steps to Reproduce:
1. I write a python program that have "import sqlite3"
2. When I run it by python it show error and crash.

Actual Results:  
Show error and crash.

Expected Results:  
The program should run and import sqlibe3 to and use sqlibe3 database.

I have installed python-2.4.4-r9 and python-2.5.1-r5. For this program I use python-2.5.1-r5.
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2008-03-01 10:25:13 UTC
It would work a lot better like this ;)

from sqlite3 import *
Comment 2 Foad Nosrati Habibi 2008-03-01 10:35:38 UTC
(In reply to comment #1)
> It would work a lot better like this ;)
> 
> from sqlite3 import *
> 

But still it gives same error:

Traceback (most recent call last):
  File "gcbot.py", line 39, in <module>
    from sqlite3 import *
  File "/usr/lib/python2.5/sqlite3/__init__.py", line 24, in <module>
    from dbapi2 import *
  File "/usr/lib/python2.5/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ImportError: No module named _sqlite3
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2008-03-01 10:42:12 UTC
-from _sqlite3 import *
+from sqlite3 import *

Spot the difference.
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2008-03-01 13:11:19 UTC
On that note

- did you compile python-2.5 w/ USE=sqlite?
- if yes, does /usr/lib/python2.5/lib-dynload/_sqlite3.so exist?
Comment 5 Foad Nosrati Habibi 2008-03-02 06:07:41 UTC
sorry from all,
problem was my use flags, it fixed. thank you
Comment 6 Jakub Moc (RETIRED) gentoo-dev 2008-03-02 07:29:41 UTC
Thanks for reporting back. :)