Search code examples
pythonjupytercx-freeze

Cannot get Unicode Executable to Run Python Script


I have created a Tkinter Application Using JupyterLab.

I have converted this to py file.

I then used cxfreeze to confert this file to an executable.

However when running the resulting file, I am receiving the following error in terminal:

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

Current thread 0x000000010c46a5c0 (most recent call first):
Abort trap: 6
logout

Is there a known way to convert the Ipynb file to a stand alone executable?

I am using MacOS. I'm unsure if this will affect how I should solve this problem.

Using cxfreeze I was able to create the exe file without issue.


Solution

  • There's a cx_Freeze Github issue addressing this error. According to the latest comment you should try applying this patch to your install of freeze.py.

    Other comments also suggest that having stray environment variables may cause similar issues.

    Let me know if that helped (if it doesn't, I'll need to have a closer look at your code!).