zoukankan      html  css  js  c++  java
  • pyinstaller 打包出现 AttributeError错误以及解决

    (Ven) F:\project\Python\Freightsmart>pyinstaller -D sutep.py
    83 INFO: PyInstaller: 4.7
    83 INFO: Python: 3.7.4
    83 INFO: Platform: Windows-10-10.0.19041-SP0
    84 INFO: wrote F:\project\Python\Freightsmart\sutep.spec
    90 INFO: UPX is not available.
    114 INFO: Extending PYTHONPATH with paths
    ['F:\\project\\Python\\Freightsmart']
    Traceback (most recent call last):
      File "E:\Python\lib\runpy.py", line 193, in _run_module_as_main
        "__main__", mod_spec)
      File "E:\Python\lib\runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "F:\project\Python\Ven\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
      File "f:\project\python\ven\lib\site-packages\PyInstaller\__main__.py", line 124, in run
        run_build(pyi_config, spec_file, **vars(args))
      File "f:\project\python\ven\lib\site-packages\PyInstaller\__main__.py", line 58, in run_build
        PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
      File "f:\project\python\ven\lib\site-packages\PyInstaller\building\build_main.py", line 782, in main
        build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
      File "f:\project\python\ven\lib\site-packages\PyInstaller\building\build_main.py", line 714, in build
        exec(code, spec_namespace)
      File "F:\project\Python\Freightsmart\sutep.spec", line 19, in <module>
        noarchive=False)
      File "f:\project\python\ven\lib\site-packages\PyInstaller\building\build_main.py", line 245, in __init__
        self.hookspath += discover_hook_directories()
      File "f:\project\python\ven\lib\site-packages\PyInstaller\building\build_main.py", line 116, in discover_hook_directories
        """
      File "f:\project\python\ven\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 91, in exec_statement
        return __exec_statement(statement, capture_stdout=True)
      File "f:\project\python\ven\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 75, in __exec_statement
        return __exec_python_cmd(cmd, capture_stdout=capture_stdout)
      File "f:\project\python\ven\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 66, in __exec_python_cmd
        txt = compat.exec_python(*cmd, env=pp_env)
      File "f:\project\python\ven\lib\site-packages\PyInstaller\compat.py", line 546, in exec_python
        return exec_command(*cmdargs, **kwargs)
      File "f:\project\python\ven\lib\site-packages\PyInstaller\compat.py", line 348, in exec_command
        out = out.decode(encoding)
    AttributeError: 'str' object has no attribute 'decode'
    
    

     File "f:\project\python\ven\lib\site-packages\PyInstaller\compat.py", line 348, in exec_command
    

    注释
            # if encoding:
            #     out = out.decode(encoding)
            # else:
    
    

  • 相关阅读:
    3、选择排序(最小值/最大值)
    2、冒泡排序
    1、快速排序
    Stream操作
    1. 两数之和
    Mysql修改字段类型修改
    获取节假日
    mysql 前缀 + 编号 补0
    一口气说出 6种@Transactional注解的失效场景
    Activiti最全入门教程(基于Eclipse插件开发)
  • 原文地址:https://www.cnblogs.com/whatarey/p/15574056.html
Copyright © 2011-2022 走看看