Error with Shelve from a frozen application

M

Marc

Hello all,

I have searched and experimented but can't find a way to make this
work. I have an application that I froze using py2exe which uses
Shelve to store data for me. This is the error I am getting:

Traceback (most recent call last):
File "<string>", line 14, in ?
File "imputil.pyc", line 103, in _import_hook
File "<string>", line 52, in _import_top_module
File "imputil.pyc", line 216, in import_top
File "imputil.pyc", line 271, in _import_one
File "<string>", line 128, in _process_result
File "anydbm.pyc", line 62, in ?
ImportError: no dbm clone found; tried ['dbhash', 'gdbm', 'dbm',
'dumbdbm']

A couple of places mentioned forcing the compiler to import the anydbm
module. I've tried this both from within the main program and from the
compiler options. Neither of them worked. Can someone please tell me
how to fix this?

Thanks ahead of time,
Marc
 
J

Josiah Carlson

Hello all,
I have searched and experimented but can't find a way to make this
work. I have an application that I froze using py2exe which uses
Shelve to store data for me. This is the error I am getting:

Traceback (most recent call last):
File "<string>", line 14, in ?
File "imputil.pyc", line 103, in _import_hook
File "<string>", line 52, in _import_top_module
File "imputil.pyc", line 216, in import_top
File "imputil.pyc", line 271, in _import_one
File "<string>", line 128, in _process_result
File "anydbm.pyc", line 62, in ?
ImportError: no dbm clone found; tried ['dbhash', 'gdbm', 'dbm',
'dumbdbm']

A couple of places mentioned forcing the compiler to import the anydbm
module. I've tried this both from within the main program and from the
compiler options. Neither of them worked. Can someone please tell me
how to fix this?

Thanks ahead of time,
Marc

I've had similar problems with attempting to force encodings imports.

At the beginning of your script, give the following a try:

for i in ['dbhash', 'gdbm', 'dbm', 'dumbdbm']:
try: eval('import '+i)
except: pass

Send it through py2exe, and give it a shot.

- Josiah
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top