gpt4 book ai didi

python - 如何使用 py2exe 将 Python PySide 文件卡住为一个 exe 文件?

转载 作者:太空宇宙 更新时间:2023-11-03 17:04:23 24 4
gpt4 key购买 nike

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

WindowsError:[错误3]系统找不到指定的路径

这是我的 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.

最佳答案

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

关于python - 如何使用 py2exe 将 Python PySide 文件卡住为一个 exe 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34722605/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com