0

I'm using Python 3.

When I use cx_Freeze, the KeyError comes out.

I tried both python setup.py build and python setup.py bdist_msi, but both didn't work.

Here's my setup.py:

import sys
from cx_Freeze import setup, Executable

setup(
    name = "SnakeGame",
    executables = [Executable("SnakeGame.py", base = "Win32GUI")]
)

How can I fix it?

Innat
  • 16,113
  • 6
  • 53
  • 101
Hoseong Jeon
  • 1,240
  • 2
  • 12
  • 20
  • have you tried this https://stackoverflow.com/a/35706103/7957705 – FKLC Jun 02 '18 at 12:59
  • I tried writing something on my setup.py file, but it didn't work. – Hoseong Jeon Jun 06 '18 at 04:13
  • And I don't know what do other things mean. Could you tell me how can I do them? – Hoseong Jeon Jun 06 '18 at 04:13
  • if you working on windows run this `python -c "import os;PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__));os.system('set TCL_LIBRARY={}'.format(os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6')));os.system('set TK_LIBRARY={}'.format(os.path.join( PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')))"` – FKLC Jun 06 '18 at 05:51
  • Thanks, but it didn't work, so I changed my setup.py code. On the site you recommanded, they said I should add `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')`, so I tried it. Then, AttributeError: 'NoneType' object has no attribute 'split' came out. Do you know how can I fix it? – Hoseong Jeon Jun 09 '18 at 09:32
  • you should give much more info about error which part of code `AttirubeError` – FKLC Jun 09 '18 at 10:20

0 Answers0