Cxfreeze widget with tkinter xgboost not showing, but no errors

My program runs in anaconda spyder. however, after freezing, all widgets that use the tkinter module work, except for the widget with xgboost and pandas. There was no error, the assembly worked, but the button does not work and does not show the widget.

I tried to import and include xgboost in the setup.py file, but all other widgets with tkinter did not work at all. However, there is no mistake. Has anyone experienced or solved this problem?

Here is the closest thing that worked. This is my setup.py when other widgets worked with tkinter, but not with xgboost and pandas.

from cx_Freeze import setup, Executable
import sys
import os

includes = []
include_files = [r"C:/Users/USER/Anaconda3/DLLs/tcl86t.dll",
         r"C:/Users/USER/Anaconda3/DLLs/tk86t.dll",
         r"C:/Users/USER/SAMPLE/xgboost_USE.model",
         r"C:/Users/USER/SAMPLE/P1.ico"]
os.environ['TCL_LIBRARY'] = "C:/Users/USER/Anaconda3/tcl/tcl8.6"
os.environ['TK_LIBRARY'] = "C:/Users/USER/Anaconda3/tcl/tk8.6"
base = 'Win32GUI' if sys.platform == 'win32' else None


setup(name=application_title, version='1.0', description='SAMPLE',
      options={"build_exe": {"includes": includes, "include_files":                 
      include_files}},executables=
      [Executable(r'C:/Users/USER/SAMPLE/sample.py', base=base)])

Please, help.

+4
source share
1 answer

xgboost, , cx pandas, numpy. , pandas ( , , , )

import sys
import cx_Freeze
import os.path
import scipy

base = None

if sys.platform == 'win32':
    base = "Win32GUI"

#This part may depend on where your installation is
#This part is essential to copy the tkinter DLL files over
PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6')
os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')
os.environ['REQUESTS_CA_BUNDLE'] = r'C:\ProgramData\Anaconda3\Lib\site-packages\botocore\vendored\requests\cacert.pem'


executables = [cx_Freeze.Executable("test.py", base=base)]
addtional_mods = ['numpy.core._methods', 'numpy.lib.format']

packages = ["idna", "numpy", "boto3", 'boto3.s3.transfer', 'boto3.s3.inject', 'multiprocessing', "xlwt", 'numpy.core._methods', 'pandas']
options = {
    'build_exe': {

        'include_files':[
            os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tk86t.dll'),
            os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tcl86t.dll'),
            os.path.dirname(scipy.__file__),
            r'C:\ProgramData\Anaconda3\Lib\site-packages\botocore\vendored\requests\cacert.pem',
            r'C:\ProgramData\Anaconda3\Lib\site-packages\botocore',

         ],
        'includes': addtional_mods,
        'packages':packages,
    },

}

cx_Freeze.setup(
    name = "Test",
    options = options,
    version = "1.0.0.0",
    description = 'Test',
    executables = executables
)
0

Source: https://habr.com/ru/post/1690916/


All Articles