【问题标题】:How to freeze Python PySide file using py2exe to one exe file?如何使用 py2exe 将 Python PySide 文件冻结为一个 exe 文件?
【发布时间】:2016-01-11 13:20:06
【问题描述】:

我尝试将我的Python PySide 文件冻结为exe,当我使用'bundle_files': 3 执行此操作时效果很好,但是当我尝试使用'bundle_files': 1 执行此操作时,我在日志中收到此错误:

WindowsError: [Error 3] The system cannot find the path specified.

这是我的 setup.py:

from distutils.core import setup
import py2exe, sys, os

sys.argv.append('py2exe')

setup(
    excludes=['_ssl',  # Exclude _ssl
                                    'pyreadline', 'difflib', 'doctest', 'locale',
                                    'optparse', 'pickle', 'calendar'],  # Exclude standard library
    dll_excludes=['msvcr71.dll'],  # Exclude msvcr71
    compressed=True,  # Compress library.zip
    options = {'py2exe': {'bundle_files': 1, 'compressed': True}},
    windows = [{'script': "myFile.py", "icon_resources": [(1, "icon.ico")]}],
    zipfile = None,
)

这是日志:

Traceback (most recent call last):
File "MultiClipboard.py", line 4, in <module>
File "zipextimporter.pyc", line 82, in load_module
File "PySide\__init__.pyc", line 41, in <module>
File "PySide\__init__.pyc", line 11, in _setupQtDirectories
File "PySide\_utils.pyc", line 97, in get_pyside_dir
File "PySide\_utils.pyc", line 88, in _get_win32_case_sensitive_name
File "PySide\_utils.pyc", line 63, in _get_win32_short_name
WindowsError: [Error 3] The system cannot find the path specified.

【问题讨论】:

  • 为什么这个问题有标签:pyinstaller?

标签: python pyside py2exe


【解决方案1】:

Py2exe64-bit machines 上不支持此功能。如果您需要将所有项目捆绑到一个文件中,则应尝试使用 pyinstaller 代替

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多