简体   繁体   中英

Turning a py2exe setup.py file into one using cx_freeze

Until now I compiled only python2.7 files using py2exe. Today I tried compiling a python3.3 file using the 3.3 version of py2exe, but the setup() raised an exception I couldn't understand ( AttributeError: 'DebugOutput' object has no attribute 'errors' ).

I thought that using a different compiling method (cx_freeze instead of py2exe) will maybe solve my problem, but I couldn't understand exactly what are the differences between them. what should I change in my code to make it work with cx_freeze? This is my setup():

setup(
    version=ver,
    description=name + ' by me',
    author='me',
    console=cons,
    windows=wind,
    data_files = [dats],
    options = {'build_exe': {'bundle_files': 1, 'compressed': True, 'optimize': 2, 'ascii': True, 'excludes': ex, 'includes': inc, 'dist_dir': distDir}},
    zipfile = None
)

Have a look at the docs for cx_freeze.

Also when you install cx_freeze there is a file you can (using python) run from command line to generate a script for you. See this page.

Hope this helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM