Pyinstaller无法加载本机模块'Crypto.Cipher .__ raw_ecb'

时间:2018-05-07 08:40:50

标签: python-3.x cryptography pyinstaller pdfminer

尝试运行程序时,我从命令行收到此错误:

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

这似乎是加密模块的一个问题,因为其他人在过去遇到过这个问题。我已经设法通过将Crypto文件夹复制到保存onedir的dist文件夹中来使其工作但这似乎不是正确的解决方案,如果我想使它成为一个文件,我不知道这将如何工作。< / p>

任何帮助将不胜感激。

提前致谢!

0 个答案:

没有答案