1

I'm trying to convert my tkinter python script into exe with cx_Freeze. From now on, I've dealt with many common problems TCL-TK, DLL and idna. It seems I solved them but now I have another problem. When I try to run the exe version of the application, I get the following error:

ImportError: The 'six' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.

import cx_Freeze
import sys
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')


base = None

if sys.platform == 'win32':
    base = 'Win32GUI'

executables = [cx_Freeze.Executable ("SeeWord.py", base=base)]

cx_Freeze.setup(name="SeeWord",
                options= {"build_exe": {"packages": ["idna", "tkinter", 
    "MySQLdb", "requests", 
    "bs4","re","random","win10toast","time","datetime","threading"] }},
                version="0.01",
                description="vocabulary application",
                executables = executables)
jpeg
  • 2,372
  • 4
  • 18
  • 31
  • 1
    What part of the error message is unclear? It says you need the `six` package, but that it wasn't included in the .exe. – Bryan Oakley Jan 29 '19 at 15:12
  • Do I need to include it in the setup.py I provided above? When I saw that it was already installed in my computer, I was confused. – suleymanyaman Jan 29 '19 at 15:22
  • „consult the packager of your distribution“ What distribution are you using? Did you install Python from source or via a package manager? – MisterMiyagi Jan 29 '19 at 15:33
  • You'll also need to let `cx_Freeze` include the TCL-TK DLLs using an `include_files` list entry in the `build_exe` options dictionary, see [this example](https://stackoverflow.com/a/52811346/8516269). – jpeg Jan 29 '19 at 16:02
  • @MisterMiyagi It was from the official website of Python as far as I remember – suleymanyaman Jan 29 '19 at 17:27

0 Answers0