import sys
import matplotlib
from cx_Freeze import setup, Executable
from pip._vendor.requests import packages
# <added>
import os.path
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')
if __name__ == '__main__':
build_exe_options = dict(
#compressed = True,
packages = ["matplotlib","tkinter"],
includes = ["sys","matplotlib.pyplot","numpy.core._methods","numpy.lib.format"],
#include_files = []
include_files = [r"C:\Python\Python36\DLLs\tcl86t.dll",
r"C:\Python\Python36\DLLs\tk86t.dll"]
)
base = None
if sys.platform == "win32":
base = "Win32GUI"
setup(
name = "HelloTest",
version = "1.0",
author="kissuu",
description = "It is test code to check matplotlib",
options = {"build_exe": build_exe_options},
#options = {"build_exe": {"packages":["tkinter"]}},
#options={"build_exe": {"includes": includes, "include_files": include_files}},
executables = [Executable("../../Hello/src/Hello.py", base=base, targetName="hello.exe")]
)