como con cx_Freeze exportar tkinter a exe con algunas librerias usadas

Iniciado por royer14, Noviembre 08, 2017, 03:20:14 PM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Hola, tengo dificultades al exportar una aplicacion grafica hecha con tkinter, pero resulta que obtengo error al exportar, seguramente se debe a que he usado muchas librerias o "packetes" que no se incluyen al exportar y como consecuencia obtengo error del exe exportado.
pueden ayudarme?.
quisiera exportar solo lo que se necesita para ejecutarlo, ya que lo exporta con un peso fenomenal.








Código: python

# estas son las librerias que debo incluir
from tkinter import *
from ttkthemes import  themed_tk as tk
from tkinter import ttk
from belfrywidgets import ToolTip
import math

from PIL import Image, ImageTk
from cx_Freeze import setup, Executable

# <added>
import os.path
PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6')
os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')
# </added>

base = None
if sys.platform == 'win32':
    base = 'Win32GUI'

executables = [
    Executable('nuevo - copia.py', base=base,
               icon ="icono.ico")
]

# <added>
options = {
    'build_exe': {'packages':["ttkthemes","belfrywidgets","math","PIL"],
        'include_files':[
            os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tk86t.dll'),
            os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tcl86t.dll'),
            "icono.ico",
         ],
    },
}
# </added>

setup(name = 'Inventario',
      version = '0.1',
      description = 'Sample cx_Freeze Tkinter script',
      # <added>
      options = options,
      # </added>
      executables = executables
      )
[code=python]





Yo te recomiendo usar Pyinstaller. Yo hice un tutorial sobre como usarlo: You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.
py2exe y cx_Freeze me parecen engorrosas, tienes que poner un archivo setup, en Pyinstaller no se nececita , y puedes poner tu propio manifest en .xml!

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Yo te recomiendo usar Pyinstaller. Yo hice un tutorial sobre como usarlo: You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login.
py2exe y cx_Freeze me parecen engorrosas, tienes que poner un archivo setup, en Pyinstaller no se nececita , y puedes poner tu propio manifest en .xml!
Esta excelente, si quisiera añadir: puede ser el autor o su pagina web, como haria?, y  otra, se compila con todas las librerias que has usado?