Search code examples
pythoncx-freeze

CX_Freeze: Python.exe not responding


I am trying to convert my text editor into an exe to sell it, but Windows says that python.exe is not responding when I try to convert it in cmd.

My file name is arshi.py.

Below is my setup.py:

import sys
from cx_Freeze import setup, Executable

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

exe = Executable(
        script = "arshi.py",
        icon = "icon.PNG",
        targetName = "Arshi.exe",
        base = base
        )

setup(
    name = "Arshi Editor",
    version = "0.1",
    description = "A lightweight text editor for Python",
    author = "Henry Zhu",
    options = {'build_exe': {"packages": ["pygments"]}},
    executables = [exe]
)

Solution

  • cx_freeze doesn't accept .png files, but rather only .ico files. Converting the .png file to an .ico file worked beautifully for me.