Ok so I have a fairly simple python program that utilizes tkinter and win32 to modify an existing excel sheet. I'm attempting to package it as an .exe with pyinstaller. I've read all the information about the 'tuple out of range' error regarding python 3.6. So I downloaded python 2.7, and I've made sure that it's earlier in the path than 3.6. When I enter: python -- version 2.7 output now and not a 3.6... however I STILL get the tuple out of range error when I try to package my .py file. I have the build and dist folder created, both are empty. It's driving me insane and I can't find anything on here about the tuple error that doesn't relate to my python version being incorrect. Any help would be GREATLY appreciated.
The traceback:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Lab>python --version
Python 2.7.13
C:\Users\Lab>C:\Python27\pyinstaller.exe --onefile C:\Python27\TableGen.py
82 INFO: PyInstaller: 3.2.1
82 INFO: Python: 3.6.2
83 INFO: Platform: Windows-7-6.1.7601-SP1
83 INFO: wrote C:\Users\Lab\TableGen.spec
84 INFO: UPX is not available.
85 INFO: Extending PYTHONPATH with paths
['C:\\Python27', 'C:\\Users\\Lab']
85 INFO: checking Analysis
85 INFO: Building Analysis because out00-Analysis.toc is non existent
86 INFO: Initializing module dependency graph...
87 INFO: Initializing module graph hooks...
89 INFO: Analyzing base_library.zip ...
Traceback (most recent call last):
File "c:\users\lab\appdata\local\programs\python\python36-32\lib\runpy.py", li
ne 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\lab\appdata\local\programs\python\python36-32\lib\runpy.py", li
ne 85, in _run_code
exec(code, run_globals)
File "C:\Python27\pyinstaller.exe\__main__.py", line 9, in <module>
File "c:\users\lab\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\lab\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\lab\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\lab\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\lab\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\building\build_main.py", line 212, in __init__
self.__postinit__()
File "c:\users\lab\appdata\local\programs\python\python36-32\lib\site-packages\PyInstaller\building\datastruct.py", line 161, in __postinit__
self.assemble()
File "c:\users\lab\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\lab\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\lab\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\lab\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\lab\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\lab\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\lab\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\lab\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\lab\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\lab\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
C:\Users\Lab>