What could be the reason for fatal python error:initfsencoding:unable to load the file system codec?

为君一笑 提交于 2019-12-28 02:09:06

问题


I am using Python 3.7 (64-bit) and installed cx_Freeze for converting .py into .exe.

I used this command prompt to convert Python script into an executable:

python [filename] build

It successfully build the executable. But when I executed my EXE file, I just get output:

fatal python error:initfsencoding:unable to load the file system codec
ImportError: invalid flags 1530052318 in 'encoding'
Current thread 0X000013f8 :

How to solve it and successfully make an executable file using cx_Freeze?


回答1:


Fixed in 4c18633. The problem is that for version x64 for Python 3.7 it is not working due to class config for freezer.py. You need to go cx_Freezer installation folder. If you have a virtual environment, go to your environment folder \lib\site-packages\cx_Freeze, find the freezer.py and add the code found on the commit.

You can find the patch at GitHub



来源:https://stackoverflow.com/questions/51183280/what-could-be-the-reason-for-fatal-python-errorinitfsencodingunable-to-load-th

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!