Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
py2exe failed to compiled
#1
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:
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 range
setup.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
Reply


Messages In This Thread
py2exe failed to compiled - by gahhon - Feb-27-2019, 12:44 PM
RE: py2exe failed to compiled - by snippsat - Feb-27-2019, 01:28 PM
RE: py2exe failed to compiled - by gahhon - Feb-27-2019, 03:44 PM
RE: py2exe failed to compiled - by snippsat - Feb-27-2019, 04:47 PM
RE: py2exe failed to compiled - by gahhon - Feb-27-2019, 05:45 PM
RE: py2exe failed to compiled - by snippsat - Feb-27-2019, 06:05 PM
RE: py2exe failed to compiled - by gahhon - Feb-27-2019, 07:07 PM
RE: py2exe failed to compiled - by snippsat - Feb-27-2019, 08:49 PM
RE: py2exe failed to compiled - by gahhon - Feb-28-2019, 10:26 AM
RE: py2exe failed to compiled - by gahhon - Mar-04-2019, 03:29 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] Py2exe Writing UNKNOWN-0.0.0-py3.7.egg-info sarahroxon7 1 973 Apr-20-2022, 08:02 AM
Last Post: VadimCr
  Py2exe and pycryptodome reks2004 5 4,263 Dec-16-2020, 06:42 PM
Last Post: reks2004
  I need my compiled Python Mac app to accept a file as a parameter Oethen 2 2,473 May-10-2020, 05:57 PM
Last Post: Oethen
  compiled cpython output wrong version bigrockcrasher 0 1,538 Feb-25-2020, 06:31 PM
Last Post: bigrockcrasher
  Py2exe Writing UNKNOWN-0.0.0-py3.7.egg-info Rickus 2 3,728 Feb-18-2020, 03:09 PM
Last Post: Rickus
  Hello Im looking for a compiled window version of 3.4.x ... SlowMotion 2 2,270 Feb-12-2019, 08:13 PM
Last Post: SlowMotion
  What are ways of pointing cross-compiled origin source line for python? wyvogew 2 2,866 Feb-02-2019, 03:16 PM
Last Post: wyvogew
  py2exe keegan_010 4 4,566 Aug-22-2018, 07:58 AM
Last Post: buran
  How would I combine multiple .py files into one .exe with Py2Exe shlomi27 0 3,147 Aug-20-2018, 10:27 AM
Last Post: shlomi27
  jira-2.0.0.dist causing error with py2exe johnlawlor 1 2,562 Aug-09-2018, 08:27 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020