每当我尝试使用我的脚本运行pyinstaller.py时,它会输出一堆代码,我不知道它意味着什么。我要做的就是将我的python文件转换为可执行文件,但它无法正常工作。看起来它正在工作,直到它在100之后显示Traceback然后它显示了一大堆文件位置。
C:\Users\Smith 1>python C:/py/pyinstaller.py C:/py/Calculator.py
84 INFO: PyInstaller: 3.2.1
84 INFO: Python: 3.6.0
84 INFO: Platform: Windows-10-10.0.14393-SP0
84 INFO: wrote C:\Users\Smith 1\Calculator.spec
84 INFO: UPX is not available.
100 INFO: Extending PYTHONPATH with paths
['C:\\py', 'C:\\Users\\Smith 1']
100 INFO: checking Analysis
100 INFO: Building Analysis because out00-Analysis.toc is non existent
100 INFO: Initializing module dependency graph...
100 INFO: Initializing module graph hooks...
100 INFO: Analyzing base_library.zip ...
Traceback (most recent call last):
File "C:/py/pyinstaller.py", line 15, in <module>
run()
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 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