推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
explist
V2EX  ›  Python

用 cx_Freeze 打包 PY3.5 后, exe 程序运行不了?

  •  
  •   explist · May 3, 2016 · 4203 views
    This topic created in 3822 days ago, the information mentioned may be changed or developed.

    cx_Freeze 是在: http://www.lfd.uci.edu/~gohlke/pythonlibs/#cx_freeze 处下载的: cx_Freeze-4.3.4-cp35-none-win32.whl

    打包一切顺利,完后将 tcl86t.dll 及 tk86t.dll 复制到打包程序里 但双击 EXE 文件却无任何反应(调用 WerFault.exe )

    setup.py 如下:

    #!/usr/bin/env python

    #coding=utf-8

    from cx_Freeze import setup,Executable import sys,os

    os.environ['TCL_LIBRARY'] = "C:\Python35\tcl\tcl8.6" os.environ['TK_LIBRARY'] = "C:\Python35\tcl\tk8.6"

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

    executables = [Executable(script='MvApp.py',base=base,compress=True,targetName='MvApp.exe')]

    build_exe_options = {'include_files':['MvApp.py'],'optimize':2}

    setup( name='MvApp', version='0.1', description='Sample script', options={'build_exe':build_exe_options}, executables=executables)

    3 replies  •  2016-05-04 16:34:06 +08:00
    kokutou
        1
    kokutou  
       May 3, 2016 via Android
    试试 nuitka 编译。
    打包用 pyinstaller
    leavic
        2
    leavic  
       May 4, 2016
    pyinstaller 才是王道
    explist
        3
    explist  
    OP
       May 4, 2016
    pyinstaller 需 pywin32,打包后的文件很大
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3985 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 05:19 · PVG 13:19 · LAX 22:19 · JFK 01:19
    ♥ Do have faith in what you're doing.