pyinstaller麻烦(编译可执行文件)

时间:2017-03-06 22:36:11

标签: python pyinstaller

我试图将我的脚本变成exe文件,但它不起作用这就是发生的代码。它最后说的是元组索引超出范围,我不知道它是什么或它意味着什么。这是我尝试将其变为可执行文件时发生的完整日志。

 C:\Users\Smith 1>pyinstaller Calculator.py
    73 INFO: PyInstaller: 3.2.1
    73 INFO: Python: 3.6.0
    73 INFO: Platform: Windows-10-10.0.14393-SP0
    75 INFO: wrote C:\Users\Smith 1\Calculator.spec
    75 INFO: UPX is not available.
    79 INFO: Extending PYTHONPATH with paths
    ['C:\\Users\\Smith 1', 'C:\\Users\\Smith 1']
    80 INFO: checking Analysis
    81 INFO: Building Analysis because out00-Analysis.toc is non existent
    81 INFO: Initializing module dependency graph...
    88 INFO: Initializing module graph hooks...
    89 INFO: Analyzing base_library.zip ...
    Traceback (most recent call last):
  File "c:\users\smith 1\appdata\local\programs\python\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\smith 1\appdata\local\programs\python\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Smith 1\AppData\Local\Programs\Python\Python36\Scripts\pyinstaller.exe\__main__.py", line 9, in <module>
  File "c:\users\smith 1\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\__main__.py", line 90, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "c:\users\smith 1\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\__main__.py", line 46, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "c:\users\smith 1\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\building\build_main.py", line 788, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "c:\users\smith 1\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\building\build_main.py", line 734, in build
    exec(text, spec_namespace)
  File "<string>", line 16, in <module>
  File "c:\users\smith 1\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\building\build_main.py", line 212, in __init__
    self.__postinit__()
  File "c:\users\smith 1\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\building\datastruct.py", line 161, in __postinit__
    self.assemble()
  File "c:\users\smith 1\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\building\build_main.py", line 317, in assemble
    excludes=self.excludes, user_hook_dirs=self.hookspath)
  File "c:\users\smith 1\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\depend\analysis.py", line 560, in initialize_modgraph
    graph.import_hook(m)
  File "c:\users\smith 1\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1509, in import_hook
    source_package, target_module_partname, level)
  File "c:\users\smith 1\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1661, in _find_head_package
    target_module_headname, target_package_name, source_package)
  File "c:\users\smith 1\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\depend\analysis.py", line 209, in _safe_import_module
    module_basename, module_name, parent_package)
  File "c:\users\smith 1\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2077, in _safe_import_module
    module_name, file_handle, pathname, metadata)
  File "c:\users\smith 1\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2115, in _load_module
    m = self._load_package(fqname, pathname, packagepath)
  File "c:\users\smith 1\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2951, in _load_package
    self._load_module(fqname, fp, buf, stuff)
  File "c:\users\smith 1\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2167, in _load_module
    self._scan_code(m, co, co_ast)
  File "c:\users\smith 1\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2585, in _scan_code
    module, module_code_object, is_scanning_imports=False)
  File "c:\users\smith 1\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2831, in _scan_bytecode
    global_attr_name = get_operation_arg_name()
  File "c:\users\smith 1\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2731, in get_operation_arg_name
    return module_code_object.co_names[co_names_index]
IndexError: tuple index out of range

1 个答案:

答案 0 :(得分:0)

Pyisntaller不支持Python 3.6.0。