Make an application using tkinter an executable file with cx_freeze

I'm addicted to cx_freeze, so make a note. The environment is window7 (64bit), python is Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32.

setup.py Sample setup.py.

setup.py


import sys

from cx_Freeze import setup, Executable

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

setup(
        name = "foo",
        version = "0.1",
        description = "foo",
        executables = [Executable("foo.py", base = base)])

From the command line

python setup.py build

You can create an exe with.

What to do if you get an error that the Tcl library cannot be found.

_tkinter.TclError: Can't find a usable init.tcl in the following directories: C:/home/workspace/tawami/software/lib/tcl8.5 C:/lib/tcl8.5 C:/lib/tcl8.5 C:/library C:/library C:/tcl8.5.10/library C:/tcl8.5.10/library

Set the environment variable TCL_LIBRARY to C: \ Python27 \ tcl \ tcl8.5, TK_LIBRARY to C: \ Python27 \ tcl \ tk8.5, etc., according to your environment.

What to do if you get a version conflict error

version conflict for package "Tcl": have 8.5.10, need exactly 8.5.2

Comment out package require -exact Tcl 8.5.2 in C: \ Python27 \ tcl \ tcl8.5 \ init.tcl and c: /lib/tk8.5/tk.tcl.

Recommended Posts

Make an application using tkinter an executable file with cx_freeze
Create an upgradeable msi file with cx_Freeze
Create a GUI executable file created with tkinter
I tried to make an OCR application with PySimpleGUI
[Python] Create a Tkinter program distribution file with cx_Freeze
Let's make dice with tkinter
[Python] I tried to make an application that calculates salary according to working hours with tkinter
Create an Excel file with Python3
I tried to make a todo application using bottle with python
Build an application with Clean Architecture while using DI + mock in Python
Create an application by classifying with Pygame
Make an audio interface controller with pyusb (2)
Creating an image splitting app with Tkinter
Make an audio interface controller with pyusb (1)
Make GUI apps super easy with tkinter
Quickly create an excel file with Python #python
Application development using SQLite with Django (PTVS)
Create an application using the Spotify API
Let's make an A to B conversion web application with Flask! From scratch ...
I tried to make a simple mail sending application with tkinter of Python
I tried to make Kana's handwriting recognition Part 3/3 Cooperation with GUI using Tkinter
[Python] Make a game with Pyxel-Use an editor-
Make a monitoring device with an infrared sensor
Create an executable file in a scripting language
Creating an interactive application using a topic model
Develop Windows apps with Python 3 + Tkinter (exe file)
[Chat De Tornado] Make a chat using WebSocket with Tornado
Upload images to S3 with GUI using tkinter
Beginners try to make an online battle Othello web application with Django + React + Bootstrap (1)
[Learning memo] How to make an application with Django ~ From virtual environment to pushing to github ~