1

I have made a GUI app which uses subliminal in it . Then i tried compiling the program using PyInstaller . When i run the exe, it gives me the following error :-

Traceback (most recent call last):
  File "main.py", line 375, in <module>
  File "main.py", line 144, in __init__
  File "site-packages\dogpile\cache\region.py", line 237, in configure
  File "site-packages\dogpile\cache\backends\file.py", line 158, in __init__
  File "site-packages\dogpile\cache\backends\file.py", line 182, in _init_dbm_file
  File "dbm\__init__.py", line 75, in open
ImportError: no dbm clone found; tried ['dbm.gnu', 'dbm.ndbm', 'dbm.dumb']
Failed to execute script main

After this i tried explicitly importing dbm in my application as like :- import dbm . But this also gives the same error.

Then I tried import dbm.gnu , dbm.ndbm , dbm.dumb . This gives another error as shown below :-

Traceback (most recent call last):
  File "main.py", line 3, in <module>
  File "c:\program files\python35\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
    exec(bytecode, module.__dict__)
  File "userinterface.py", line 312, in <module>
  File "c:\program files\python35\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
    exec(bytecode, module.__dict__)
  File "main.py", line 9, in <module>
  File "c:\program files\python35\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
    exec(bytecode, module.__dict__)
  File "dbm\ndbm.py", line 3, in <module>
ImportError: No module named '_dbm'
Failed to execute script main

Some googling and i found that it uses _dbm package from dbm.gdbm . so instead of import dbm.gnu , dbm.ndbm , dbm.dumb , I used import dbm.dumb .

Surprisingly, doing this started my application . But the subliminal doesn't find any subtitle now. So it's total useless now .

What i am doing wrong . whats the right way to fix this problem. while compiling , i have also tried giving --hidden-import dbm with no luck.


Here is the command that i use to compile using pyinstaller :-

pyinstaller main.py --hidden-import dbm --hidden-import dogpile.cache.backends.file  --additional-hooks-dir=. --add-data guessit;guessit --add-data babelfish;babelfish -i vid2.ico -n Subtitler

I would be grateful for any clue or help :)

Natesh bhat
  • 12,274
  • 10
  • 84
  • 125

1 Answers1

0

I found that , in _dbm package only works in UNIX like systems .

After some fiddling with it and finally fixed it .

In your main python file just use this import :-

import dbm.dump
Natesh bhat
  • 12,274
  • 10
  • 84
  • 125