Closed davidsj2 closed 1 year ago
Try this:
pip uninstall -y cx_Freeze
pip install --no-binary=cx_Freeze cx_Freeze
In fact, I've looked at the python source, and it could be that one (or more) modules aren't loading.
Try using on the command line --includes=_sha256
python setup.py build_exe --includes=_sha256
or w/ cxfreeze ----includes=_sha256 ...
Thanks; installing from source worked. Do you want me to try again with a binary wheel with flag?
Yes, please test.
I'm running this from setup, so I I changed build_exe
of options
to look like:
build_exe_options = {
'packages': ['inflection'],
'include_files': ['dmcompiler/templates/'],
'includes': ['_sha256']}
set in setup
via:
options = {'build_exe': build_exe_options},
I get the same stack trace with those updates when reverting back to binary wheel.
The binary wheels are made using CentOS7 (manylinux2014) and apparently have some issues with OpenSSL and FIPSMODE. As python 3.6 is EOL and from source worked, I'll close the issue.
FWIW, this also happens on el8 with Python 3.8:
Traceback (most recent call last):
File "/ssd/davidsj2/repos/dmcompiler/venv38/lib/python3.8/site-packages/cx_Freeze/initscripts/__startup__.py", line 124, in run
module_init.run(name + "__main__")
File "/ssd/davidsj2/repos/dmcompiler/venv38/lib/python3.8/site-packages/cx_Freeze/initscripts/console.py", line 16, in run
exec(code, module_main.__dict__)
File "dmcompiler/dmc.py", line 14, in <module>
import dmcompiler.structure as structure
File "/ssd/davidsj2/repos/dmcompiler/dmcompiler/structure.py", line 19, in <module>
from pygccxml import declarations
File "/ssd/davidsj2/repos/dmcompiler/venv38/lib/python3.8/site-packages/pygccxml/__init__.py", line 33, in <module>
from . import parser
File "/ssd/davidsj2/repos/dmcompiler/venv38/lib/python3.8/site-packages/pygccxml/parser/__init__.py", line 12, in <module>
from .project_reader import COMPILATION_MODE
File "/ssd/davidsj2/repos/dmcompiler/venv38/lib/python3.8/site-packages/pygccxml/parser/project_reader.py", line 11, in <module>
from . import source_reader
File "/ssd/davidsj2/repos/dmcompiler/venv38/lib/python3.8/site-packages/pygccxml/parser/source_reader.py", line 15, in <module>
from . import declarations_cache
File "/ssd/davidsj2/repos/dmcompiler/venv38/lib/python3.8/site-packages/pygccxml/parser/declarations_cache.py", line 8, in <module>
import hashlib
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
File "<frozen zipimport>", line 259, in load_module
File "/ssd/davidsj2/repos/dmcompiler/venv38/lib64/python3.8/hashlib.py", line 218, in <module>
if not _hashlib.get_fips_mode():
AttributeError: module '_hashlib' has no attribute 'get_fips_mode'
Seems like it's Red Hat patched in el8+ systems: https://bugzilla.redhat.com/show_bug.cgi?format=multiple&id=1745685 https://raw.githubusercontent.com/openela-main/python3/352f011d1bb441e4f8fcf20da041780254486597/SOURCES/00329-fips.patch
OS: Red Hat Enterprise Linux release 8.7 (Ootpa Python: Python 3.6.8 (default, Oct 20 2022, 09:31:56) [GCC 8.5.0 20210514 (Red Hat 8.5.0-15)] on linux cx_Freeze version: 6.13.2 (plus older versions e.g. 6.11.1)
Note: this same issue was encountered by someone else here: https://stackoverflow.com/questions/73505683/attributeerror-module-hashlib-has-no-attribute-get-fips-mode
When building an executable using cx_Freeze, we see the following when invoking it:
Any ideas what could cause this?