安装方式:
pip3 install pyinstaller
pip3 install PyQt5
版本:
pyinstaller:3.4 ;
pyqt:5.11.3 ;
python:3.6 ;
直接在 pycharm 里面 python 代码运行,功能一切正常; 打包时,报错。
日志如下:
C:\Python36\Scripts\pyinstaller.exe -c -w -i E:\Eric6_Workspace\ID_Number\090105\idNum_main.ico -D E:\Eric6_Workspace\ID_Number\090105\
idNum_main.py546 INFO: PyInstaller: 3.4
546 INFO: Python: 3.6.4
547 INFO: Platform: Windows-10-10.0.14393-SP0
567 INFO: wrote E:\Eric6_Workspace\ID_Number\090105\idNum_main.spec
'upx' �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���
591 INFO: UPX is not available.
633 INFO: Extending PYTHONPATH with paths
['E:\\Eric6_Workspace\\ID_Number\\090105',
'E:\\Eric6_Workspace\\ID_Number\\090105']
633 INFO: checking Analysis
633 INFO: Building Analysis because Analysis-00.toc is non existent
633 INFO: Initializing module dependency graph...
637 INFO: Initializing module graph hooks...
657 INFO: Analyzing base_library.zip ...
6322 INFO: running Analysis Analysis-00.toc
6387 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\python36\python.exe
7692 INFO: Caching module hooks...
7748 INFO: Analyzing E:\Eric6_Workspace\ID_Number\090105\
idNum_main.py7952 INFO: Loading module hooks...
7952 INFO: Loading module hook "
hook-encodings.py"...
8214 INFO: Loading module hook "
hook-pydoc.py"...
8215 INFO: Loading module hook "
hook-PyQt5.py"...
8457 WARNING: Cannot read QLibraryInfo output: raised Expecting value: line 1 column 1 (char 0) when decoding:
Traceback (most recent call last):
File "C:\Python36\Scripts\
pyinstaller-script.py", line 11, in <module>
load_entry_point('PyInstaller==3.4', 'console_scripts', 'pyinstaller')()
File "c:\python36\lib\site-packages\PyInstaller\
__main__.py", line 111, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:\python36\lib\site-packages\PyInstaller\
__main__.py", line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\python36\lib\site-packages\PyInstaller\building\
build_main.py", line 838, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "c:\python36\lib\site-packages\PyInstaller\building\
build_main.py", line 784, in build
exec(text, spec_namespace)
File "<string>", line 17, in <module>
File "c:\python36\lib\site-packages\PyInstaller\building\
build_main.py", line 241, in __init__
self.__postinit__()
File "c:\python36\lib\site-packages\PyInstaller\building\
datastruct.py", line 158, in __postinit__
self.assemble()
File "c:\python36\lib\site-packages\PyInstaller\building\
build_main.py", line 500, in assemble
module_hook.post_graph()
File "c:\python36\lib\site-packages\PyInstaller\building\
imphook.py", line 410, in post_graph
self._load_hook_module()
File "c:\python36\lib\site-packages\PyInstaller\building\
imphook.py", line 377, in _load_hook_module
self.hook_module_name, self.hook_filename)
File "c:\python36\lib\site-packages\PyInstaller\
compat.py", line 736, in importlib_load_source
return mod_loader.load_module()
File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
File "<frozen importlib._bootstrap_external>", line 823, in load_module
File "<frozen importlib._bootstrap_external>", line 682, in load_module
File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
File "<frozen importlib._bootstrap>", line 684, in _load
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "c:\python36\lib\site-packages\PyInstaller\hooks\
hook-PyQt5.py", line 23, in <module>
collect_system_data_files(pyqt5_library_info.location['PrefixPath'],
File "c:\python36\lib\site-packages\PyInstaller\utils\hooks\
qt.py", line 67, in __getattr__
qli = json.loads(json_str)
File "c:\python36\lib\json\
__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "c:\python36\lib\json\
decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "c:\python36\lib\json\
decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Process finished with exit code 1