Почему, когда я указываю путь к python3 в файле, он все равно обрабатывает через python2?
Я работаю с pyinstaller-3.2, который интерпретирует фалы через python2.7, а мне нужен python3. Указываю путь к python3
#!/usr/bin/env python3
Даже
#!/usr/bin/python3
Но, при сборке, он просто не читает указатель пути к python3
./pyinstaller.py --onefile main.py
А выдает ошибку: по понятным причинам
File "/home/pepe/PyInstaller-3.2/main.py", line 2
print('Hello', end=' ')
^
SyntaxError: invalid syntax
файла main.py:
#!/usr/bin/env python3
print('Hello', end=' ')
с использованием интерпретатора python3
python3 -m PyInstaller *args
выдает ошибку
107 INFO: PyInstaller: 3.2
108 INFO: Python: 3.8.10
116 INFO: Platform: Linux-5.15.0-57-generic-x86_64-with-glibc2.29
117 INFO: wrote /home/pepe/PyInstaller-3.2/*args/*args.spec
119 INFO: UPX is not available.
120 INFO: Extending PYTHONPATH with paths
['/home/pepe/PyInstaller-3.2', '/home/pepe/PyInstaller-3.2/*args']
120 INFO: checking Analysis
120 INFO: Building Analysis because out00-Analysis.toc is non existent
120 INFO: Initializing module dependency graph...
121 INFO: Initializing module graph hooks...
122 INFO: Analyzing base_library.zip ...
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/pepe/PyInstaller-3.2/PyInstaller/__main__.py", line 97, in <module>
run()
File "/home/pepe/PyInstaller-3.2/PyInstaller/__main__.py", line 90, in run
run_build(pyi_config, spec_file, **vars(args))
File "/home/pepe/PyInstaller-3.2/PyInstaller/__main__.py", line 46, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "/home/pepe/PyInstaller-3.2/PyInstaller/building/build_main.py", line 788, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "/home/pepe/PyInstaller-3.2/PyInstaller/building/build_main.py", line 734, in build
exec(text, spec_namespace)
File "<string>", line 6, in <module>
File "/home/pepe/PyInstaller-3.2/PyInstaller/building/build_main.py", line 212, in __init__
self.__postinit__()
File "/home/pepe/PyInstaller-3.2/PyInstaller/building/datastruct.py", line 178, in __postinit__
self.assemble()
File "/home/pepe/PyInstaller-3.2/PyInstaller/building/build_main.py", line 316, in assemble
self.graph = initialize_modgraph(
File "/home/pepe/PyInstaller-3.2/PyInstaller/depend/analysis.py", line 560, in initialize_modgraph
graph.import_hook(m)
File "/home/pepe/PyInstaller-3.2/PyInstaller/lib/modulegraph/modulegraph.py", line 906, in import_hook
q, tail = self._find_head_package(parent, name, level)
File "/home/pepe/PyInstaller-3.2/PyInstaller/lib/modulegraph/modulegraph.py", line 990, in _find_head_package
q = self._safe_import_module(head, qname, parent)
File "/home/pepe/PyInstaller-3.2/PyInstaller/depend/analysis.py", line 208, in _safe_import_module
return super(PyiModuleGraph, self)._safe_import_module(
File "/home/pepe/PyInstaller-3.2/PyInstaller/lib/modulegraph/modulegraph.py", line 1210, in _safe_import_module
module = self._load_module(
File "/home/pepe/PyInstaller-3.2/PyInstaller/lib/modulegraph/modulegraph.py", line 1295, in _load_module
self._scan_code(m, co, co_ast)
File "/home/pepe/PyInstaller-3.2/PyInstaller/lib/modulegraph/modulegraph.py", line 1460, in _scan_code
self._scan_bytecode_stores(co, m)
File "/home/pepe/PyInstaller-3.2/PyInstaller/lib/modulegraph/modulegraph.py", line 1505, in _scan_bytecode_stores
name = co.co_names[oparg]
IndexError: tuple index out of range