Python - Convertir Web2Py en .exe con CX_Freeze

 
Vista:
sin imagen de perfil

Convertir Web2Py en .exe con CX_Freeze

Publicado por Nahuel (1 intervención) el 04/05/2017 15:03:12
Estimados, tengo un problema, quiero convertir la app creada en Web2Py en una app .exe, pero cuando ejecuto cx-freeze me dice este error:

1
2
3
4
5
6
7
8
9
10
11
12
Traceback (most recent call last):
  File "setup.py", line 10, in <module>
    from cx_Freeze import setup, Executable
  File "C:\Python27\lib\site-packages\cx_Freeze\__init__.py", line 11, in <modul
e>
    from cx_Freeze.freezer import *
  File "C:\Python27\lib\site-packages\cx_Freeze\freezer.py", line 13, in <module
>
    import socket
  File "C:\Python27\lib\socket.py", line 47, in <module>
    import _socket
ImportError: DLL load failed: No se encontr¾ el proceso especificado.

Creo que es por que estoy tratando de compilar a otro .exe, que es Web2Py, ahora paso el script setup.py:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env python
# -*- coding: utf-8 -*-
 
"""
Usage:
    Install cx_Freeze: http://cx-freeze.sourceforge.net/
    Copy script to the web2py directory
    c:\Python27\python standalone_exe_cxfreeze.py build_exe
"""
from cx_Freeze import setup, Executable
from gluon.import_all import base_modules, contributed_modules
from gluon.fileutils import readlines_file
from glob import glob
import fnmatch
import os
import shutil
import sys
import re
 
#read web2py version from VERSION file
web2py_version_line = readlines_file('VERSION')[0]
#use regular expression to get just the version number
v_re = re.compile('[0-9]+\.[0-9]+\.[0-9]+')
web2py_version = v_re.search(web2py_version_line).group(0)
 
base = None
 
 
 
if sys.platform == 'win32':
    base = "Win32GUI"
 
base_modules.remove('macpath')
buildOptions = dict(
    compressed=True,
    excludes=["macpath", "PyQt4"],
    includes=base_modules,
    include_files=[
        'applications',
        'ABOUT',
        'LICENSE',
        'VERSION',
        'logging.example.conf',
        'options_std.py',
        'app.example.yaml',
        'queue.example.yaml',
    ],
    # append any extra module by extending the list below -
    # "contributed_modules+["lxml"]"
    packages=contributed_modules,
)
 
setup(
    name="Web2py",
    version=web2py_version,
    author="Massimo DiPierro",
    description="web2py web framework",
    license="LGPL v3",
    options=dict(build_exe=buildOptions),
    executables=[Executable("web2py.py",
                            base=base,
                            compress=True,
                            icon="web2py.ico",
                            targetName="web2py.exe",
                            copyDependentFiles=True)],
)

El problema es que no me doy cuenta si existe alguna forma de compilar a binario o convertir en .exe la app creada con web2py.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder