Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#67 py2exe doesn't find shelve related libs

open
nobody
None
5
2005-02-17
2005-02-17
Anonymous
No

Using shelves end up in executables which are lacking
support of databases.
---
import shelve

initvalues = shelve.open("foodata.pickle", writeback=True)
initvalues['foo']= ["bababar", "somevalue"]
initvalues.close()
---

pythonexed with this minimalisticsetup.py
---
from distutils.core import setup
import py2exe
# Command line: python setup.py py2exe -i anydbm,dbhash
setup(
windows = [{'script': 'test_shelve.py',
'includes': ['anydbm', 'dbhash'],
'packages': ['anydbm', 'dbhash']},
]
)
---
the loader seems not to find all libs:
---
The following modules appear to be missing
['_pybsddb']
---

And the executable ends up in a startup error

---
Traceback (most recent call last):
File "test_shelve.py", line 3, in ?
File "shelve.pyc", line 231, in open
File "shelve.pyc", line 211, in __init__
File "anydbm.pyc", line 62, in ?
ImportError: no dbm clone found; tried ['dbhash',
'gdbm', 'dbm', 'dumbdbm']
Exception exceptions.AttributeError: "DbfilenameShelf
instance has no attribute 'writeback'" in
---

Discussion