Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 355367 - dev-lang/python-2.6.x: dbhash.py: ImportError: No module named bsddb
Summary: dev-lang/python-2.6.x: dbhash.py: ImportError: No module named bsddb
Status: RESOLVED DUPLICATE of bug 372605
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-17 21:14 UTC by Andreas Mueller
Modified: 2011-07-11 08:15 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Adds dev-lang/python[berkdb] to the ebuild (exaile-0.3.2.0.ebuild.patch,314 bytes, patch)
2011-02-20 17:27 UTC, Vicente Olivert Riera (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Mueller 2011-02-17 21:14:40 UTC
After the last upgrade, exaile won't start anymore, using --debug gives the following information:

21:38:02,164:ERROR   : Failed to open music DB. (xl.trax.trackdb)
21:38:02,164:DEBUG   : Exception caught!
Traceback (most recent call last):
  File "/usr/lib64/exaile/xl/trax/trackdb.py", line 169, in load_from_location
    protocol=common.PICKLE_PROTOCOL)
  File "/usr/lib64/python2.6/shelve.py", line 239, in open
    return DbfilenameShelf(filename, flag, protocol, writeback)
  File "/usr/lib64/python2.6/shelve.py", line 223, in __init__
    Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback)
  File "/usr/lib64/python2.6/anydbm.py", line 82, in open
    mod = __import__(result)
  File "/usr/lib64/python2.6/dbhash.py", line 8, in <module>
    import bsddb
ImportError: No module named bsddb
 (xl.trax.trackdb)

Apparently, it missed bsddb, and can't read my music db without it. 

Adding 'dev-lang/python berkdb' to /etc/portage/package.use solved the problem; but maybe it would be a good idea to add the requirement to have python with bsddb to the exaile ebuild.

The problem can also be solved by removing ~/.local/share/exaile, so I guess it's not a problem for new installations, but users who already have a DB get stuck.

Reproducible: Always

Steps to Reproduce:
Comment 1 Wormo (RETIRED) gentoo-dev 2011-02-18 20:17:23 UTC
Could you have changed berkdb useflag at some point, without afterwards emerging world with -N flag?
Comment 2 Andreas Mueller 2011-02-19 01:19:26 UTC
I'm pretty sure I haven't touched the berkdb useflag.

I just found http://bugs.gentoo.org/show_bug.cgi?id=286972 (deprecation of bsddb in python); which I think explains the problem.

I'm not sure about the best solution though. Removing the db is not nice, since I guess it would make me loose ratings, etc.

Comment 3 Vicente Olivert Riera (RETIRED) gentoo-dev 2011-02-20 14:14:38 UTC
When you upgrade python, emerge log says:

* "bsddb" module is out-of-date and no longer maintained inside dev-lang/python. It has
* been additionally removed in Python 3. You should use external, still maintained "bsddb3"
* module provided by dev-python/bsddb3 which supports both Python 2 and Python 3.

Have you tried that?
Comment 4 Andreas Mueller 2011-02-20 16:19:06 UTC
I did install bsddb3, but that didn't help. I assume the code for exaile would have to be updated to use bsddb3 instead of bsddb first.
Comment 5 Vicente Olivert Riera (RETIRED) gentoo-dev 2011-02-20 17:15:23 UTC
dev-lang/python-2.6.6-r1 (the current stable version in portage) ebuild has a "-berkdb" IUSE, but media-sound/exaile-0.3.2.0 (the current stable version in portage) needs it to get working the collection database.

So..., in my opinion, the media-sound/exaile-0.3.2.0 ebuild should have dev-lang/python[berkdb] into RDEPEND variable.
Comment 6 Vicente Olivert Riera (RETIRED) gentoo-dev 2011-02-20 17:27:54 UTC
Created attachment 263179 [details, diff]
Adds dev-lang/python[berkdb] to the ebuild
Comment 7 Wormo (RETIRED) gentoo-dev 2011-02-21 05:45:36 UTC
Sounds like a good suggestion, handing it off to exaile maintainers
Comment 8 Samuli Suominen (RETIRED) gentoo-dev 2011-03-28 13:29:42 UTC
(In reply to comment #0)
> After the last upgrade, exaile won't start anymore, using --debug gives the
> following information:
>   File "/usr/lib64/python2.6/dbhash.py", line 8, in <module>
>     import bsddb
> ImportError: No module named bsddb

I can't find any reference to 'bsddb' in exaile.   But file dbhash.py is part of dev-lang/python itself:

$ qfile -v dbhash.py
dev-lang/python-2.7.1-r1 (/usr/lib64/python2.7/dbhash.py)

$ grep -i bsddb /usr/lib64/python2.7/dbhash.py
"""Provide a (g)dbm-compatible interface to bsddb.hashopen."""
    import bsddb
error = bsddb.error                     # Exported for anydbm
    return bsddb.hashopen(file, flag, mode)

So it's a problem with dev-lang/python?
Comment 9 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2011-03-28 17:07:18 UTC
>=dev-lang/python-2.7.2_pre20110227[berkdb] prints the following warning:

 * "bsddb" module is out-of-date and no longer maintained inside dev-lang/python.
 * "bsddb" and "dbhash" modules have been additionally removed in Python 3.
 * You should use external, still maintained "bsddb3" module provided by dev-python/bsddb3,
 * which supports both Python 2 and Python 3.

>=dev-lang/python-2.7.2_pre20110327[-berkdb] removes dbhash.py.

Maybe there should be a warning telling people to migrate databases when migrating from dev-lang/python[berkdb] to dev-lang/python[-berkdb].
Comment 10 Samuli Suominen (RETIRED) gentoo-dev 2011-07-11 08:15:08 UTC

*** This bug has been marked as a duplicate of bug 372605 ***