概述
Pyinstaller加密打包遇到的坑
原来使用Anaconda3-2019.07-Windows-x86_64,Pyinstaller 3.4版本。升级到Anaconda3-2020.02-Windows-x86_64或者Python 3.7.7,使用Pyinstaller进行加密打包成EXE文件,可以成功打包。但是,运行加密的EXE文件,总是报下面错误:
Traceback (most recent call last): File “c:pythonpython37libsite-packagesPyInstallerloaderpyimod03_importers.py”, line 434, in get_code return self._pyz_archive.extract(fullname)[1] File “c:pythonpython37libsite-packagesPyInstallerloaderpyimod02_archive.py”, line 369, in extract obj = zlib.decompress(obj)zlib.error: Error -3 while decompressing data: incorrect header check
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File “site-packagesPyInstallerloaderpyiboot01_bootstrap.py”, line 27, in File “c:pythonpython37libsite-packagesPyInstallerloaderpyimod03_importers.py”, line 603, in exec_module bytecode = self.get_code(spec.loader_state) File “c:pythonpython37libsite-packagesPyInstallerloaderpyimod03_importers.py”, line 436, in get_code raise ImportError('Loader FrozenImporter cannot handle module ’ + fullname)ImportError: Loader FrozenImporter cannot handle module os[91896] Failed to execute script pyiboot01_bootstrap
把加密包从PyCryPto更换到PyCryPtoDome,再更换到PyCryPtoDomex,都不能解决。在网上找到很多资料,也没能找到解决方案。后来,在GitHub的Pyinstaller问题列表中,找到了遇到同样问题的人,按其中的解决方法,解决了问题:
https://github.com/pyinstaller/pyinstaller/issues/2247
原来,升级版本后,PyInstaller的版本,安装时,也升级成PyInstaller 3.6。而打包时,没有使用–clean参数,进行清空缓存。更换了PyInstaller版本,第一次打包时,需要增加–clean参数,做一次清空缓存操作:
Pyinstaller --distpath=g:tempdist xxx.spec --clean
原文链接:https://blog.csdn.net/u011195887/article/details/105456945
最后
以上就是甜美小懒虫为你收集整理的python3打包exe 加密_Pyinstaller加密打包遇到的坑的全部内容,希望文章能够帮你解决python3打包exe 加密_Pyinstaller加密打包遇到的坑所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复