最新版的 pyinstaller 有 bug 吗?在打包的时候, pyinstaller/hook 中的 PyQt5 文件一直报错。跪求大神指点! Orz - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
520Python
V2EX    Python

最新版的 pyinstaller 有 bug 吗?在打包的时候, pyinstaller/hook 中的 PyQt5 文件一直报错。跪求大神指点! Orz

  •  
  •   520Python 2019-01-11 11:47:25 +08:00 4377 次点击
    这是一个创建于 2537 天前的主题,其中的信息可能已经有所发展或是发生改变。
    安装方式:
    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.py
    546 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' е

    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.py
    7952 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_oad_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
    3 条回复    2019-01-13 13:30:55 +08:00
    520Python
        1
    520Python  
    OP
       2019-01-11 13:14:31 +08:00 via Android
    没人遇到过这个问题吗?
    whi147
        2
    whi147  
       2019-01-12 17:27:34 +08:00 via Android
    你看下 pyinstaller 和版本是否兼容 Python3.6
    520Python
        3
    520Python  
    OP
       2019-01-13 13:30:55 +08:00 via Android
    @whi147 感谢,把 python 降至 3.5,就正常了。
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     1925 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 26ms UTC 16:13 PVG 00:13 LAX 08:13 JFK 11:13
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86