Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Py2exe and pycryptodome
#1
Hello,

I have problem with compiling application by py2exe.
Application uses Crypto libs (pycryptodome). My setup.py
from distutils.core import setup
import py2exe

setup(
    options = {'py2exe': {'compressed': True, 'bundle_files': 0, 'excludes': ['tcl', 'tkinter'], 'packages': ['Crypto'],
                          }},
    windows=[{'script':'test.py'}],
    zipfile = None, #"lib/shared.lib",
   
 
)
But when i want start app i get errors like
Error:
Traceback (most recent call last): File "test.py", line 9, in <module> File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 668, in _load_unlocked File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible File "zipextimporter.pyc", line 87, in load_module File "Crypto\Cipher\__init__.pyc", line 27, in <module> File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 668, in _load_unlocked File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible File "zipextimporter.pyc", line 87, in load_module File "Crypto\Cipher\_mode_ecb.pyc", line 47, in <module> File "Crypto\Util\_raw_api.pyc", line 308, in load_pycryptodome_raw_lib OSError: Cannot load native module 'Crypto.Cipher._raw_ecb': Trying '_raw_ecb.cp37-win_amd64.pyd': cannot load library 'C:\xxx\test.exe\Crypto\Util\..\Cipher\_raw_ecb.cp37-win_amd64.pyd': error 0x7e. Additionally, ctypes.util.find_library() did not manage to locate a library called 'C:\\xxx\\test.exe\\Crypto\\Util\\..\\Cipher\\_raw_ecb.cp37-win_amd64.pyd', Trying '_raw_ecb.pyd': cannot load library 'C:\xxx\test.exe\Crypto\Util\..\Cipher\_raw_ecb.pyd': error 0x7e. Additionally, ctypes.util.find_library() did not manage to locate a library called 'C:\\xxx\\test.exe\\Crypto\\Util\\..\\Cipher\\_raw_ecb.pyd'
I checked, path are right and file exist(for example file name is _raw_ecb.pyd).
Any idea? Problem dont occur if i use bundle_file=3 and files arent packed to exe or lib file (when i use zip option).

Best regards,
Reply


Messages In This Thread
Py2exe and pycryptodome - by reks2004 - Dec-16-2020, 05:52 AM
RE: Py2exe and pycryptodome - by snippsat - Dec-16-2020, 12:18 PM
RE: Py2exe and pycryptodome - by reks2004 - Dec-16-2020, 12:53 PM
RE: Py2exe and pycryptodome - by snippsat - Dec-16-2020, 02:54 PM
RE: Py2exe and pycryptodome - by reks2004 - Dec-16-2020, 03:17 PM
RE: Py2exe and pycryptodome - by reks2004 - Dec-16-2020, 06:42 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] Py2exe Writing UNKNOWN-0.0.0-py3.7.egg-info sarahroxon7 1 982 Apr-20-2022, 08:02 AM
Last Post: VadimCr
  Py2exe Writing UNKNOWN-0.0.0-py3.7.egg-info Rickus 2 3,749 Feb-18-2020, 03:09 PM
Last Post: Rickus
  py2exe failed to compiled gahhon 9 7,678 Mar-04-2019, 03:29 AM
Last Post: gahhon
  py2exe keegan_010 4 4,598 Aug-22-2018, 07:58 AM
Last Post: buran
  How would I combine multiple .py files into one .exe with Py2Exe shlomi27 0 3,164 Aug-20-2018, 10:27 AM
Last Post: shlomi27
  jira-2.0.0.dist causing error with py2exe johnlawlor 1 2,586 Aug-09-2018, 08:27 PM
Last Post: Larz60+
  can not open .exe file generated by py2exe: ImportError: cannot import name _remove_d py2exe 0 2,787 May-22-2018, 09:57 AM
Last Post: py2exe
  trouble with pip and py2exe sylas 12 14,115 Sep-17-2017, 06:38 AM
Last Post: sylas
  Convert py2exe daltorya19 6 5,519 May-28-2017, 11:48 PM
Last Post: daltorya19
  Py2EXE: terminal window closes after pressing ENTER peanutbutterjelly 1 5,175 May-06-2017, 07:13 PM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020