0

Running my frozen script stops immediately with this message: 1

Fatal Python error: initfsencoding: unable to load the file system codec.
ImportError: invalid flags 1530064918 in 'encodings'

Current thread 0x00000f94 (most recent call first): 

I use Python 3.7.0 and cx_Freeze 5.1.1 (64bit).

My script:

import os
from cx_Freeze import setup, Executable

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')

build_exe_options={
            'packages':['copy', 'tkinter', 'os', 'pandas',
                'numpy', 'scipy', 'csv', 'datetime', 'matplotlib']

executables=[Executable("Data_GUI_11.py")]

setup(name='Data_GUI_11',
    version=0.1,
    description='Data reader and plotter',
    options={"build_exe": build_exe_options},
    executables=executables
    )

There might be more errors – it is my first attempt with cx_Freeze. No clue…

Thank you.

corkplug
  • 11
  • 2
  • Possible duplicate of [Cx\_freeze crashing Python3.7.0](https://stackoverflow.com/questions/51314105/cx-freeze-crashing-python3-7-0) – jpeg Sep 03 '18 at 05:26
  • cx_Freeze has currently a bug with Python 3.7. Until a corrected version of cx_Freeze is issued, you have two options: use Python 3.6 or manually patch your local cx_Freeze package as described in https://stackoverflow.com/q/51314105/8516269 – jpeg Sep 03 '18 at 11:04
  • Thank you, I patched the cx_Freeze and it works. – corkplug Sep 08 '18 at 17:11

1 Answers1

0

Try to code in the previous versions of python like python 3.6 or python 3.5.There are problems in python 3.7 with cx_Freeze.I have backdated to python 3.6 and not having those problems now.

Khan Asfi Reza
  • 566
  • 5
  • 28