4

When attempting to run my program i receive this error from the command line:

Traceback (most recent call last):
  File "cp file.py", line 16, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\users\tom\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\pdfminer\pdfpage.py", line 11, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\users\tom\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\pdfminer\pdfdocument.py", line 12, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\users\tom\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\Crypto\Cipher\__init__.py", line 3, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\users\tom\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\Crypto\Cipher\_mode_ecb.py", line 46, in <module>
  File "site-packages\Crypto\Util\_raw_api.py", line 258, in load_pycryptodome_raw_lib
OSError: Cannot load native module 'Crypto.Cipher._raw_ecb': Trying '_raw_ecb.cp36-win32.pyd': Failed to load dynlib/dll 'C:\\Users\\Tom\\Desktop\\MOT new certificates 05 05 18\\dist\\MOT Saver\\Crypto\\Util\\..\\Cipher\\_raw_ecb.cp36-win32.pyd'. Most probably this dynlib/dll was not found when the application was frozen., Trying '_raw_ecb.pyd': Failed to load dynlib/dll 'C:\\Users\\Tom\\Desktop\\MOT new certificates 05 05 18\\dist\\MOT Saver\\Crypto\\Util\\..\\Cipher\\_raw_ecb.pyd'. Most probably this dynlib/dll was not found when the application was frozen.
[7516] Failed to execute script cp file

it seems to be a problem with the crypto module as others have had problems with this in the past. i have managed to get it to work by copying the Crypto folder into the dist folder where the onedir is saved but this doesnt seem like the correct solution and if i want to make it a onefile i'm not sure how this would work.

any help would be much appreciated.

Thanks in advance!

user488476
  • 39
  • 3

0 Answers0