Pyinstaller doesn't work in python 3.7 (can't find module 'encodings')

会有一股神秘感。 提交于 2019-11-27 07:02:09

问题


I have test program below - I compiled the code with pyinstaller (Python ver 3.7b. windows 10 - 64bit) noticed warnings during compilations and error. I would appreciate any insight to resolving this issue.

Test.py
import encodings
print('Test')

Sample of Compilations Warning

102 INFO: PyInstaller: 3.3.1
102 INFO: Python: 3.7.0b1
104 INFO: Platform: Windows-10-10.0.14393-SP0
2771 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\apps\python\python37\python.exe
2801 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\apps\python\python37\python.exe

Error - executing the program Fatal Python error: initfsencoding:
unable to load the file system codec zipimport.ZipImportError:
can't find module 'encodings' Current thread 0x0000289c (most recent call first):


回答1:


I have the same error (zipimport.ZipImportError: can't find module 'encodings').

I think it has to do with Python 3.7 not supporting pyinstaller yet...




回答2:


I had the same problem and I resolve it by replacing Python 3.7, to Python 3.6.5 in my Windows 10 pro OS. During compilation of my python script using PyInstall i am still getting these WARNING: lib not found: api-ms-win-crtXXX... warnings, but the final executable works fine w/o any error.




回答3:


I also encountered the same error. I upgraded pyinstaller to the latest version[3.4] and the problem is solved. My environmental information is as follows: windows 7,python 3.7.0,pyinstaller 3.1. Reference source:zipimport.ZipImportError: can't find module 'encodings'




回答4:


Was trying to install Python and took the latest version (3.7.2). Got the same error (or while setting it up with the installer, gave the cryptic "Access Denied" issue, which led to a different set of issues/resolutions.

Finally, just changed to an earlier release (v3.5.2 for now) and that worked smoothly. Saves time, if you're trying to get other things done! As someone pointed out already, it probably has to do with PyInstaller not being supported (yet?)



来源:https://stackoverflow.com/questions/48872724/pyinstaller-doesnt-work-in-python-3-7-cant-find-module-encodings

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