V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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 · 2016-05-03 17:45:38 +08:00 · 3536 次点击
    这是一个创建于 2934 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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 条回复    2016-05-04 16:34:06 +08:00
    kokutou
        1
    kokutou  
       2016-05-03 18:44:41 +08:00 via Android
    试试 nuitka 编译。
    打包用 pyinstaller
    leavic
        2
    leavic  
       2016-05-04 14:20:58 +08:00
    pyinstaller 才是王道
    explist
        3
    explist  
    OP
       2016-05-04 16:34:06 +08:00
    pyinstaller 需 pywin32,打包后的文件很大
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1049 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 20:12 · PVG 04:12 · LAX 13:12 · JFK 16:12
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.