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 · 3984 次点击
    这是一个创建于 2145 天前的主题,其中的信息可能已经有所发展或是发生改变。
    安装方式:
    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' �����ڲ����ⲿ���Ҳ���ǿ����е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.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_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
    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   ·   实用小工具   ·   1007 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 21:39 · PVG 05:39 · LAX 13:39 · JFK 16:39
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.