No Module _cffi_ Freezing With Cx_freeze
I am developing a PySide application (Qt for Python) and I would like to freeze it using cx_Freeze. When I run python setup.py build using my setup file below, it creates the build
Solution 1:
I think I solved it by modifying setup.py
as below:
import os.path
PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
build_exe_options = {"include_files" : [
os.path.join(PYTHON_INSTALL_DIR, "DLLs", "libcrypto-1_1-x64.dll"),
os.path.join(PYTHON_INSTALL_DIR, "DLLs", "libssl-1_1-x64.dll")]}
build_exe_options = {"packages": ['cffi', 'cryptography'], 'include_files': ['images\\', os.path.join(PYTHON_INSTALL_DIR, "DLLs", "libcrypto-1_1-x64.dll"),
os.path.join(PYTHON_INSTALL_DIR, "DLLs", "libssl-1_1-x64.dll")]}
target = Executable(
script="main_window.py",
base = "Win32GUI",
icon="images\\icon.ico"
)
setup(name = "DemiurgoXMLgen" ,
version = "0.1" ,
description = "" ,
options={'build_exe': build_exe_options},
executables = [target])
and modifying in paramiko->ed25519key.py
the import:
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.backendsimport openssl as openssl_backend
Essentially:
- explicitly specify the import of
cffi
andcryptography
inbuild_exe_options
- copy the dlls for
libcrypto-1_1-x64.dl
l andlibssl-1_1-x64.dll
- explicitly specify the backend as
openssl_backend
instead ofdefault_backend
Post a Comment for "No Module _cffi_ Freezing With Cx_freeze"