I am using Python 3.7.2 and py2exe 0.9.2.2
I have followed the tutorial from Py2exe Tutorial
But I am still failed to convert the script into executable file as I can't find any right solution through google search.
Log:
But failed to execute the .exe file to other machine that don't have Python installed.
After I searched, I found out that py2exe approach is able to execute the .exe file in Non-Python machine.
Please kindly advise.Thanks
I have followed the tutorial from Py2exe Tutorial
But I am still failed to convert the script into executable file as I can't find any right solution through google search.
Log:
C:\Users\Jack Wong\Desktop\PythonTutorial>python setup.py py2exe running py2exe Traceback (most recent call last): File "setup.py", line 4, in <module> setup(console=['google.py']) File "C:\Users\Jack Wong\AppData\Local\Programs\Python\Python37\lib\distutils\core.py", line 148, in setup dist.run_commands() File "C:\Users\Jack Wong\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 966, in run_commands self.run_command(cmd) File "C:\Users\Jack Wong\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command cmd_obj.run() File "C:\Users\Jack Wong\AppData\Local\Programs\Python\Python37\lib\site-packages\py2exe\distutils_buildexe.py", line 188, in run self._run() File "C:\Users\Jack Wong\AppData\Local\Programs\Python\Python37\lib\site-packages\py2exe\distutils_buildexe.py", line 267, in _run builder.analyze() File "C:\Users\Jack Wong\AppData\Local\Programs\Python\Python37\lib\site-packages\py2exe\runtime.py", line 160, in analyze self.mf.import_hook(modname) File "C:\Users\Jack Wong\AppData\Local\Programs\Python\Python37\lib\site-packages\py2exe\mf3.py", line 120, in import_hook module = self._gcd_import(name) File "C:\Users\Jack Wong\AppData\Local\Programs\Python\Python37\lib\site-packages\py2exe\mf3.py", line 274, in _gcd_import return self._find_and_load(name) File "C:\Users\Jack Wong\AppData\Local\Programs\Python\Python37\lib\site-packages\py2exe\mf3.py", line 357, in _find_and_load self._scan_code(module.__code__, module) File "C:\Users\Jack Wong\AppData\Local\Programs\Python\Python37\lib\site-packages\py2exe\mf3.py", line 388, in _scan_code for what, args in self._scan_opcodes(code): File "C:\Users\Jack Wong\AppData\Local\Programs\Python\Python37\lib\site-packages\py2exe\mf3.py", line 417, in _scan_opcodes yield "store", (names[oparg],) IndexError: tuple index out of rangesetup.py
from distutils.core import setup import py2exe setup(console=['google.py'])Previously I am used the pyinstaller to convert and it successful to execute the .exe file in my machine.
But failed to execute the .exe file to other machine that don't have Python installed.
After I searched, I found out that py2exe approach is able to execute the .exe file in Non-Python machine.
Please kindly advise.Thanks