py2exe does not compile the executable

0

I'm trying to make an executable of a program made in python3.6 but when I run python setup.py py2exe it gives me the following error:

running py2exe
Traceback (most recent call last):
  File "setup.py", line 5, in <module>
    console=[{"script": "main.py"}]
  File "C:\Python36\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Python36\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "C:\Python36\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Python36\lib\site-packages\py2exe\distutils_buildexe.py", line 188, in run
    self._run()
  File "C:\Python36\lib\site-packages\py2exe\distutils_buildexe.py", line 267, in _run
    builder.analyze()
  File "C:\Python36\lib\site-packages\py2exe\runtime.py", line 160, in analyze
    self.mf.import_hook(modname)
  File "C:\Python36\lib\site-packages\py2exe\mf3.py", line 120, in import_hook
    module = self._gcd_import(name)
  File "C:\Python36\lib\site-packages\py2exe\mf3.py", line 274, in _gcd_import
    return self._find_and_load(name)
  File "C:\Python36\lib\site-packages\py2exe\mf3.py", line 357, in _find_and_load
    self._scan_code(module.__code__, module)
  File "C:\Python36\lib\site-packages\py2exe\mf3.py", line 388, in _scan_code
    for what, args in self._scan_opcodes(code):
  File "C:\Python36\lib\site-packages\py2exe\mf3.py", line 417, in _scan_opcodes
    yield "store", (names[oparg],)
IndexError: tuple index out of range

the code in python is:

print("Hola mundo")
a = input("su nombre es: ")
print("hola {}".format(a))

and the setup.py:

from distutils.core import setup
import py2exe

setup(
    console=[{"script": "main.py"}]
)
    
asked by Reinier Hernández Ávila 25.06.2018 в 20:35
source

1 answer

0

The problem is that I installed TensorFlow on my machine, it has a dependency on enum34, uninstalling it solved the problem. Thanks to @fjsevilla and this link I resolved this.

    
answered by 26.06.2018 в 04:04