LeetaoGoooo / MovieHeavens

🎬 基于Pyqt5的简单电影搜索工具
GNU General Public License v2.0
641 stars 149 forks source link

打包失败 #14

Closed lovecn closed 5 years ago

lovecn commented 5 years ago

执行 python movies.py 没问题,打包失败了

λ pyinstaller -F -w ./movies.py ./movieSource/MovieHeaven.py ./movieSource/fake_user_agent.py
417 INFO: PyInstaller: 3.4
418 INFO: Python: 3.7.0
423 INFO: Platform: Windows-7-6.1.7601-SP1
426 INFO: wrote d:\code\MovieHeavens\movies.spec
440 INFO: UPX is not available.
444 INFO: Extending PYTHONPATH with paths
['d:\\code\\MovieHeavens',
 'd:\\code\\MovieHeavens\\movieSource',
 'd:\\code\\MovieHeavens\\movieSource',
 'd:\\code\\MovieHeavens']
447 INFO: checking Analysis
447 INFO: Building Analysis because Analysis-00.toc is non existent
447 INFO: Initializing module dependency graph...
454 INFO: Initializing module graph hooks...
479 INFO: Analyzing base_library.zip ...
Traceback (most recent call last):
  File "<string>", line 41, in <module>
  File "<string>", line 13, in walk_packages
  File "d:\python\lib\pkgutil.py", line 130, in iter_modules
    for name, ispkg in iter_importer_modules(i, prefix):
  File "d:\python\lib\pkgutil.py", line 149, in _iter_file_finder_modules
    import inspect
  File "d:\python\lib\inspect.py", line 40, in <module>
    import linecache
  File "d:\python\lib\linecache.py", line 11, in <module>
    import tokenize
  File "d:\python\lib\tokenize.py", line 33, in <module>
    import re
  File "d:\python\lib\re.py", line 143, in <module>
    class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
Traceback (most recent call last):
  File "<string>", line 41, in <module>
  File "<string>", line 13, in walk_packages
  File "d:\python\lib\pkgutil.py", line 130, in iter_modules
    for name, ispkg in iter_importer_modules(i, prefix):
  File "d:\python\lib\pkgutil.py", line 149, in _iter_file_finder_modules
    import inspect
  File "d:\python\lib\inspect.py", line 40, in <module>
    import linecache
  File "d:\python\lib\linecache.py", line 11, in <module>
    import tokenize
  File "d:\python\lib\tokenize.py", line 33, in <module>
    import re
  File "d:\python\lib\re.py", line 143, in <module>
    class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
5523 INFO: running Analysis Analysis-00.toc
5557 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by d:\python\python.exe
6021 INFO: Caching module hooks...
6028 INFO: Analyzing d:\code\MovieHeavens\movies.py
7030 INFO: Processing pre-safe import module hook   urllib3.packages.six.moves
Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "d:\python\lib\site-packages\urllib3\__init__.py", line 8, in <module>
    from .connectionpool import (
  File "d:\python\lib\site-packages\urllib3\connectionpool.py", line 3, in <module>
    import logging
  File "d:\python\lib\logging\__init__.py", line 26, in <module>
    import sys, os, time, io, traceback, warnings, weakref, collections.abc
  File "d:\python\lib\traceback.py", line 5, in <module>
    import linecache
  File "d:\python\lib\linecache.py", line 11, in <module>
    import tokenize
  File "d:\python\lib\tokenize.py", line 33, in <module>
    import re
  File "d:\python\lib\re.py", line 143, in <module>
    class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
Traceback (most recent call last):
  File "d:\python\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "d:\python\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\python\Scripts\pyinstaller.exe\__main__.py", line 9, in <module>
  File "d:\python\lib\site-packages\PyInstaller\__main__.py", line 111, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "d:\python\lib\site-packages\PyInstaller\__main__.py", line 63, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "d:\python\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 "d:\python\lib\site-packages\PyInstaller\building\build_main.py", line 784, in build
    exec(text, spec_namespace)
  File "<string>", line 17, in <module>
  File "d:\python\lib\site-packages\PyInstaller\building\build_main.py", line 241, in __init__
    self.__postinit__()
  File "d:\python\lib\site-packages\PyInstaller\building\datastruct.py", line 158, in __postinit__
    self.assemble()
  File "d:\python\lib\site-packages\PyInstaller\building\build_main.py", line 443, in assemble
    priority_scripts.append(self.graph.run_script(script))
  File "d:\python\lib\site-packages\PyInstaller\depend\analysis.py", line 201, in run_script
    self._top_script_node = super(PyiModuleGraph, self).run_script(pathname)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1348, in run_script
    self._scan_code(m, co, co_ast)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2544, in _scan_code
    self._process_imports(module)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2743, in _process_imports
    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2221, in _safe_import_hook
    target_attr_names=None, level=level, edge_attr=edge_attr)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1422, in import_hook
    target_module = self._load_tail(target_package, target_module_partname)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1635, in _load_tail
    submodule = self._safe_import_module(head, mname, submodule)
  File "d:\python\lib\site-packages\PyInstaller\depend\analysis.py", line 271, in _safe_import_module
    module_basename, module_name, parent_package)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1990, in _safe_import_module
    module_name, file_handle, pathname, metadata)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2082, in _load_module
    self._scan_code(m, co, co_ast)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2544, in _scan_code
    self._process_imports(module)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2743, in _process_imports
    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2221, in _safe_import_hook
    target_attr_names=None, level=level, edge_attr=edge_attr)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1421, in import_hook
    source_package, target_module_partname, level)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1573, in _find_head_package
    target_module_headname, target_package_name, source_package)
  File "d:\python\lib\site-packages\PyInstaller\depend\analysis.py", line 271, in _safe_import_module
    module_basename, module_name, parent_package)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1990, in _safe_import_module
    module_name, file_handle, pathname, metadata)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2028, in _load_module
    m = self._load_package(fqname, pathname, packagepath)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2813, in _load_package
    self._load_module(fqname, fp, buf, stuff)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2082, in _load_module
    self._scan_code(m, co, co_ast)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2544, in _scan_code
    self._process_imports(module)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2743, in _process_imports
    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2221, in _safe_import_hook
    target_attr_names=None, level=level, edge_attr=edge_attr)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1421, in import_hook
    source_package, target_module_partname, level)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1573, in _find_head_package
    target_module_headname, target_package_name, source_package)
  File "d:\python\lib\site-packages\PyInstaller\depend\analysis.py", line 271, in _safe_import_module
    module_basename, module_name, parent_package)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1990, in _safe_import_module
    module_name, file_handle, pathname, metadata)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2028, in _load_module
    m = self._load_package(fqname, pathname, packagepath)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2813, in _load_package
    self._load_module(fqname, fp, buf, stuff)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2082, in _load_module
    self._scan_code(m, co, co_ast)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2544, in _scan_code
    self._process_imports(module)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2743, in _process_imports
    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2221, in _safe_import_hook
    target_attr_names=None, level=level, edge_attr=edge_attr)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1421, in import_hook
    source_package, target_module_partname, level)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1573, in _find_head_package
    target_module_headname, target_package_name, source_package)
  File "d:\python\lib\site-packages\PyInstaller\depend\analysis.py", line 271, in _safe_import_module
    module_basename, module_name, parent_package)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1990, in _safe_import_module
    module_name, file_handle, pathname, metadata)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2082, in _load_module
    self._scan_code(m, co, co_ast)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2544, in _scan_code
    self._process_imports(module)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2743, in _process_imports
    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2221, in _safe_import_hook
    target_attr_names=None, level=level, edge_attr=edge_attr)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1421, in import_hook
    source_package, target_module_partname, level)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1573, in _find_head_package
    target_module_headname, target_package_name, source_package)
  File "d:\python\lib\site-packages\PyInstaller\depend\analysis.py", line 271, in _safe_import_module
    module_basename, module_name, parent_package)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1990, in _safe_import_module
    module_name, file_handle, pathname, metadata)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2082, in _load_module
    self._scan_code(m, co, co_ast)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2544, in _scan_code
    self._process_imports(module)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2743, in _process_imports
    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2221, in _safe_import_hook
    target_attr_names=None, level=level, edge_attr=edge_attr)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1422, in import_hook
    target_module = self._load_tail(target_package, target_module_partname)
  File "d:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1635, in _load_tail
    submodule = self._safe_import_module(head, mname, submodule)
  File "d:\python\lib\site-packages\PyInstaller\depend\analysis.py", line 260, in _safe_import_module
    hook_module.pre_safe_import_module(hook_api)
  File "d:\python\lib\site-packages\PyInstaller\hooks\pre_safe_import_module\hook-urllib3.packages.six.moves.py", line 31, in pre_safe_import_module
    for real_module_name, six_module_name in real_to_six_module_name.items():
AttributeError: 'str' object has no attribute 'items'
LeetaoGoooo commented 5 years ago

试一下更新 setuptools

pip install --upgrade setuptools --ignore-installed