2

I am new to Python. I am trying to create executable file with cx_freeze but after the file is created the exe cannot be started. I am getting following error: Error message

I am using pytone 3.6.0

Code

import sys
import os
os.environ['TCL_LIBRARY'] = "C:\\Users\\Valeri\\AppData\\Local\\Programs\\Python\\Python36-32\\tcl\\tcl8.6"
os.environ['TK_LIBRARY'] = "C:\\Users\\Valeri\\AppData\\Local\\Programs\\Python\\Python36-32\\tcl\\tk8.6"
from cx_Freeze import setup, Executable
# replaces commandline arg 'build'
sys.argv.append("build")  
# change the filename to your program file --->
filename = "SolutionGenerator.py"
base = None
if sys.platform == "win32":
    base = "Win32GUI"
setup(
    name = "Circle",
    version = "1.0",
    description = "cx_Freeze Tkinter script",
    executables = [Executable(filename, base=base)])

setup.py

import sys import os os.environ['TCL_LIBRARY'] = "C:\\Users\\Valeri\\AppData\\Local\\Programs\\Python\\Python36-32\\tcl\\tcl8.6" os.environ['TK_LIBRARY'] = "C:\\Users\\Valeri\\AppData\\Local\\Programs\\Python\\Python36-32\\tcl\\tk8.6" from cx_Freeze import setup, Executable "SolutionGenerator.py" base = None if sys.platform == "win32":
    base = "Win32GUI" setup(
    name = "Circle",
    version = "1.0",
    description = "cx_Freeze Tkinter script",
    executables = [Executable(filename, base=base)])

I tried everything i found in internet but cannot get this exe working. Is there other possibilities to create exe from py in Python 3.6?

Mateusz Piotrowski
  • 8,029
  • 10
  • 53
  • 79
Val
  • 73
  • 1
  • 1
  • 5

1 Answers1

0

I had exactly the same issue and solved it by copying manually the following dll in the exe directory:

  • %PYTHON%\DLLs\tcl86t.dll
  • %PYTHON%\DLLs\tk86t.dll
AlexB
  • 1