如何使用py2exe将Python Python PySide文件冻结为一个exe文件?

2024-10-01 02:22:28 发布

您现在位置:Python中文网/ 问答频道 /正文

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

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

这是我的设置.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,
)

以下是日志:

^{pr2}$

Tags: pyimporttruesslsyssetuplibraryfiles