由于Win32兼容模块,PyInstaller引发ValueError

时间:2020-06-13 17:53:19

标签: python cmd exe pyinstaller win32com

我正在尝试从Python脚本创建EXE文件,该脚本包含带有 PyInstaller win32com模块,但是在执行时会引发ValueError

我在命令提示符窗口中编写了以下命令行,以弄清为什么它不起作用:

pyinstaller --log-level=DEBUG system_activation.py

我看到 PyInstaller 正在搜索

中的模块
c:\program files (x86)\python\python36\lib\site-packages\win32comext

代替

c:\program files (x86)\python\python36\lib\site-packages\win32com

如何在正确的文件夹中进行 PyInstaller 搜索?

这是我执行的命令行,最终输出ValueError

pyinstaller --log-level=DEBUG system_activation.py
C:\wamp64\www\try_final>pyinstaller --log-level=DEBUG system_activation.py
74 INFO: PyInstaller: 3.6
74 INFO: Python: 3.6.3
75 INFO: Platform: Windows-10-10.0.18362-SP0
81 INFO: wrote C:\wamp64\www\try_final\system_activation.spec
81 DEBUG: Testing for UPX ...
84 INFO: UPX is not available.
85 DEBUG: script: C:\wamp64\www\try_final\system_activation.py
86 INFO: Extending PYTHONPATH with paths
['C:\\wamp64\\www\\try_final', 'C:\\wamp64\\www\\try_final']
92 INFO: checking Analysis
93 INFO: Building Analysis because Analysis-00.toc is non existent
96 INFO: Initializing module dependency graph...
104 INFO: Caching module graph hooks...
115 INFO: Analyzing base_library.zip ...
115 DEBUG: Collecting submodules for collections
242 DEBUG: collect_submodules - Found submodules: {'collections.abc', 'collections'}
243 DEBUG: Collecting submodules for encodings
363 DEBUG: collect_submodules - Found submodules: {'encodings.cp273', 'encodings.oem', 'encodings.cp950', 'encodings.iso8859_6', 'encodings.utf_8_sig', 'encodings.mac_roman', 'encodings.cp437', 'encodings.cp1254', 'encodings.cp874', 'encodings.koi8_t', 'encodings.cp037', 'encodings.utf_8', 'encodings.cp860', 'encodings.iso8859_14', 'encodings.utf_16_be', 'encodings.iso2022_jp_ext', 'encodings', 'encodings.quopri_codec', 'encodings.iso8859_3', 'encodings.gb2312', 'encodings.ascii', 'encodings.cp1252', 'encodings.tis_620', 'encodings.cp850', 'encodings.iso8859_1', 'encodings.euc_jp', 'encodings.johab', 'encodings.charmap', 'encodings.mac_latin2', 'encodings.iso8859_4', 'encodings.gb18030', 'encodings.cp1255', 'encodings.uu_codec', 'encodings.aliases', 'encodings.cp852', 'encodings.cp932', 'encodings.iso2022_jp_2', 'encodings.utf_32_be', 'encodings.cp869', 'encodings.iso8859_13', 'encodings.mac_greek', 'encodings.iso2022_jp_3', 'encodings.utf_7', 'encodings.palmos', 'encodings.mac_croatian', 'encodings.iso8859_11', 'encodings.kz1048', 'encodings.unicode_internal', 'encodings.raw_unicode_escape', 'encodings.iso8859_16', 'encodings.iso8859_15', 'encodings.undefined', 'encodings.hz', 'encodings.cp855', 'encodings.mac_farsi', 'encodings.cp862', 'encodings.iso8859_5', 'encodings.cp861', 'encodings.cp1140', 'encodings.iso8859_8', 'encodings.big5hkscs', 'encodings.iso2022_kr', 'encodings.iso8859_10', 'encodings.iso2022_jp', 'encodings.iso8859_2', 'encodings.mac_romanian', 'encodings.mbcs', 'encodings.utf_16_le', 'encodings.ptcp154', 'encodings.koi8_r', 'encodings.gbk', 'encodings.utf_32_le', 'encodings.cp866', 'encodings.utf_32', 'encodings.cp865', 'encodings.rot_13', 'encodings.hex_codec', 'encodings.cp857', 'encodings.cp858', 'encodings.cp424', 'encodings.cp1256', 'encodings.cp863', 'encodings.cp1250', 'encodings.idna', 'encodings.cp1258', 'encodings.mac_turkish', 'encodings.punycode', 'encodings.cp775', 'encodings.cp949', 'encodings.euc_jis_2004', 'encodings.cp1006', 'encodings.mac_centeuro', 'encodings.mac_arabic', 'encodings.euc_kr', 'encodings.base64_codec', 'encodings.cp1257', 'encodings.shift_jis', 'encodings.cp1251', 'encodings.cp864', 'encodings.iso2022_jp_1', 'encodings.cp1026', 'encodings.koi8_u', 'encodings.cp737', 'encodings.hp_roman8', 'encodings.cp720', 'encodings.unicode_escape', 'encodings.mac_iceland', 'encodings.big5', 'encodings.cp856', 'encodings.iso8859_9', 'encodings.cp500', 'encodings.zlib_codec', 'encodings.mac_cyrillic', 'encodings.cp1253', 'encodings.euc_jisx0213', 'encodings.latin_1', 'encodings.iso2022_jp_2004', 'encodings.cp1125', 'encodings.bz2_codec', 'encodings.iso8859_7', 'encodings.shift_jisx0213', 'encodings.shift_jis_2004', 'encodings.cp65001', 'encodings.utf_16', 'encodings.cp875'}
4453 INFO: Caching module dependency graph...
4516 DEBUG: Adding python files to base_library.zip
4583 INFO: running Analysis Analysis-00.toc
4583 DEBUG: Analyzing c:\program files (x86)\python\python36\python.exe
4610 DEBUG: Dependent assemblies of c:\program files (x86)\python\python36\python.exe:
4611 DEBUG: *_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_none
4612 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by c:\program files (x86)\python\python36\python.exe
4616 DEBUG: Skipping assembly *_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_none
4637 DEBUG: Adding VCRUNTIME140.dll dependency of python.exe from c:\program files (x86)\python\python36\VCRUNTIME140.dll
4640 DEBUG: Adding python36.dll dependency of python.exe from c:\program files (x86)\python\python36\python36.dll
4643 DEBUG: Skipping KERNEL32.dll dependency of python.exe
4648 DEBUG: Analyzing c:\program files (x86)\python\python36\VCRUNTIME140.dll
4661 DEBUG: Skipping KERNEL32.dll dependency of VCRUNTIME140.dll
4665 DEBUG: Analyzing c:\program files (x86)\python\python36\python36.dll
4667 DEBUG: Dependent assemblies of c:\program files (x86)\python\python36\python36.dll:
4667 DEBUG: *_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_none
4671 DEBUG: Skipping assembly *_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.0.0_none
4700 DEBUG: Skipping WS2_32.dll dependency of python36.dll
4703 DEBUG: Skipping VERSION.dll dependency of python36.dll
4707 DEBUG: Skipping ADVAPI32.dll dependency of python36.dll
4714 DEBUG: Skipping ole32.dll dependency of python36.dll
4717 DEBUG: Skipping OLEAUT32.dll dependency of python36.dll
4725 DEBUG: Skipping KERNEL32.dll dependency of python36.dll
4732 DEBUG: Skipping SHLWAPI.dll dependency of python36.dll
4737 INFO: Analyzing C:\wamp64\www\try_final\system_activation.py
6717 INFO: Processing pre-find module path hook   distutils
6718 INFO: distutils: retargeting to non-venv dir 'c:\\program files (x86)\\python\\python36\\lib'
6789 INFO: Processing pre-safe import module hook   win32com
6790 DEBUG: win32com: extending __path__ with dir 'c:\\program files (x86)\\python\\python36\\lib\\site-packages\\win32comext'
8969 INFO: Processing pre-find module path hook   site
8970 INFO: site: retargeting to fake-dir 'c:\\program files (x86)\\python\\python36\\lib\\site-packages\\PyInstaller\\fake-modules'
10660 INFO: Processing pre-safe import module hook   setuptools.extern.six.moves
14909 INFO: Processing pre-safe import module hook   urllib3.packages.six.moves
Traceback (most recent call last):
  File "c:\program files (x86)\python\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\program files (x86)\python\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Program Files (x86)\Python\Python36\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\__main__.py", line 114, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\__main__.py", line 65, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\building\build_main.py", line 734, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\building\build_main.py", line 681, in build
    exec(code, spec_namespace)
  File "C:\wamp64\www\try_final\system_activation.spec", line 17, in <module>
    noarchive=False)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\building\build_main.py", line 244, in __init__
    self.__postinit__()
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\building\datastruct.py", line 160, in __postinit__
    self.assemble()
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\building\build_main.py", line 416, in assemble
    priority_scripts.append(self.graph.run_script(script))
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\depend\analysis.py", line 249, in run_script
    self._top_script_node = super(PyiModuleGraph, self).run_script(pathname)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1408, in run_script
    self._scan_code(m, co, co_ast)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2643, in _scan_code
    self._process_imports(module)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2842, in _process_imports
    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2298, in _safe_import_hook
    target_attr_names=None, level=level, edge_attr=edge_attr)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1481, in import_hook
    source_package, target_module_partname, level)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1638, in _find_head_package
    target_module_headname, target_package_name, source_package)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\depend\analysis.py", line 382, in _safe_import_module
    module_basename, module_name, parent_package)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2055, in _safe_import_module
    module_name, file_handle, pathname, metadata)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2159, in _load_module
    self._scan_code(m, co, co_ast)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2643, in _scan_code
    self._process_imports(module)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2842, in _process_imports
    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2298, in _safe_import_hook
    target_attr_names=None, level=level, edge_attr=edge_attr)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1481, in import_hook
    source_package, target_module_partname, level)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1638, in _find_head_package
    target_module_headname, target_package_name, source_package)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\depend\analysis.py", line 382, in _safe_import_module
    module_basename, module_name, parent_package)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2055, in _safe_import_module
    module_name, file_handle, pathname, metadata)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2159, in _load_module
    self._scan_code(m, co, co_ast)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2643, in _scan_code
    self._process_imports(module)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2842, in _process_imports
    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2298, in _safe_import_hook
    target_attr_names=None, level=level, edge_attr=edge_attr)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1481, in import_hook
    source_package, target_module_partname, level)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1638, in _find_head_package
    target_module_headname, target_package_name, source_package)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\depend\analysis.py", line 382, in _safe_import_module
    module_basename, module_name, parent_package)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2055, in _safe_import_module
    module_name, file_handle, pathname, metadata)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2093, in _load_module
    m = self._load_package(fqname, pathname, packagepath)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2912, in _load_package
    self._load_module(fqname, fp, buf, stuff)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2159, in _load_module
    self._scan_code(m, co, co_ast)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2643, in _scan_code
    self._process_imports(module)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2842, in _process_imports
    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2508, in _safe_import_hook
    edge_attr=edge_attr)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1498, in import_hook
    target_module, target_attr_names):
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1792, in _import_importable_package_submodules
    attr_name, submodule_name, package)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\depend\analysis.py", line 382, in _safe_import_module
    module_basename, module_name, parent_package)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2055, in _safe_import_module
    module_name, file_handle, pathname, metadata)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2093, in _load_module
    m = self._load_package(fqname, pathname, packagepath)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2912, in _load_package
    self._load_module(fqname, fp, buf, stuff)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2159, in _load_module
    self._scan_code(m, co, co_ast)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2643, in _scan_code
    self._process_imports(module)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2842, in _process_imports
    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2298, in _safe_import_hook
    target_attr_names=None, level=level, edge_attr=edge_attr)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1482, in import_hook
    target_module = self._load_tail(target_package, target_module_partname)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1701, in _load_tail
    submodule = self._safe_import_module(head, mname, submodule)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\depend\analysis.py", line 382, in _safe_import_module
    module_basename, module_name, parent_package)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2055, in _safe_import_module
    module_name, file_handle, pathname, metadata)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2159, in _load_module
    self._scan_code(m, co, co_ast)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2643, in _scan_code
    self._process_imports(module)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2842, in _process_imports
    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2298, in _safe_import_hook
    target_attr_names=None, level=level, edge_attr=edge_attr)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1481, in import_hook
    source_package, target_module_partname, level)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1638, in _find_head_package
    target_module_headname, target_package_name, source_package)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\depend\analysis.py", line 382, in _safe_import_module
    module_basename, module_name, parent_package)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2055, in _safe_import_module
    module_name, file_handle, pathname, metadata)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2159, in _load_module
    self._scan_code(m, co, co_ast)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2643, in _scan_code
    self._process_imports(module)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2842, in _process_imports
    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2298, in _safe_import_hook
    target_attr_names=None, level=level, edge_attr=edge_attr)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1482, in import_hook
    target_module = self._load_tail(target_package, target_module_partname)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1701, in _load_tail
    submodule = self._safe_import_module(head, mname, submodule)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\depend\analysis.py", line 382, in _safe_import_module
    module_basename, module_name, parent_package)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2055, in _safe_import_module
    module_name, file_handle, pathname, metadata)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2093, in _load_module
    m = self._load_package(fqname, pathname, packagepath)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2912, in _load_package
    self._load_module(fqname, fp, buf, stuff)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2159, in _load_module
    self._scan_code(m, co, co_ast)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2643, in _scan_code
    self._process_imports(module)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2842, in _process_imports
    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2508, in _safe_import_hook
    edge_attr=edge_attr)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1498, in import_hook
    target_module, target_attr_names):
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1792, in _import_importable_package_submodules
    attr_name, submodule_name, package)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\depend\analysis.py", line 382, in _safe_import_module
    module_basename, module_name, parent_package)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2055, in _safe_import_module
    module_name, file_handle, pathname, metadata)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2159, in _load_module
    self._scan_code(m, co, co_ast)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2643, in _scan_code
    self._process_imports(module)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2842, in _process_imports
    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2298, in _safe_import_hook
    target_attr_names=None, level=level, edge_attr=edge_attr)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1481, in import_hook
    source_package, target_module_partname, level)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1638, in _find_head_package
    target_module_headname, target_package_name, source_package)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\depend\analysis.py", line 382, in _safe_import_module
    module_basename, module_name, parent_package)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2055, in _safe_import_module
    module_name, file_handle, pathname, metadata)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2093, in _load_module
    m = self._load_package(fqname, pathname, packagepath)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2912, in _load_package
    self._load_module(fqname, fp, buf, stuff)
  File "c:\program files (x86)\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2105, in _load_module
    co = compile(contents, pathname, 'exec', ast.PyCF_ONLY_AST, True)
ValueError: source code string cannot contain null bytes

0 个答案:

没有答案