0

I am trying to create an executable from my Python project using cx_Freeze, but keep running into this error:

enter image description here

Here's my setup.py:

import cx_Freeze
import os, sys

os.environ['TCL_LIBRARY'] = "D:\\Code\\Python\\3.5.2\\tcl\\tcl8.6"
os.environ['TK_LIBRARY'] = "D:\\Code\\Python\\3.5.2\\tcl\\tk8.6"

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

executables = [cx_Freeze.Executable("Main.pyw", base=base)]
includes      = ["tkinter"]
include_files = [r"D:\Code\Python\3.5.2\tcl\DLLs\tcl86t.dll", \
                 r"D:\Code\Python\3.5.2\tcl\DLLs\tk86t.dll"]

cx_Freeze.setup(
    name="Test", 
    version = "1.0",
    options={"Test.exe": {"packages":["pygame", "numpy"], "includes": includes, "include_files": include_files}}, 
    executables = executables)

I tried putting tkinter in the "packages" list, but still get the same error. I also checked other StackOverflow posts and used parts of their setup.py code into mine, but nothing is working. I can't use PyInstaller as it doesn't support pygame and py2exe doesn't support Python 3.5. Any help would be appreciated.

o.o
  • 3,563
  • 9
  • 42
  • 71

1 Answers1

0

Copy and Paste the files (tcl86t.dll, tk86t.dll) to the exe.win . It worked for me.