【发布时间】:2013-07-07 03:46:18
【问题描述】:
我的问题:
我遇到了这个问题,如果我尝试在使用 Pyqt/Pyside 的 python 文件上运行 py2exe,则在尝试运行在 I:\Documents\Python\Buttonio_Testio\dist 中生成的 EXE 时会收到以下错误:
运行 Package.exe 时收到错误:
I:\Documents\Python\Buttonio_Testio\dist>Package.exe
Traceback (most recent call last):
File "Package.py", line 1, in <module>
File "PySide\__init__.pyc", line 55, in <module>
File "PySide\__init__.pyc", line 11, in _setupQtDirectories
File "PySide\_utils.pyc", line 87, in get_pyside_dir
File "PySide\_utils.pyc", line 83, in _get_win32_case_sensitive_name
File "PySide\_utils.pyc", line 58, in _get_win32_short_name
WindowsError: [Error 3] The system cannot find the path specified.
我的 setup.py 看起来像这样:
from distutils.core import setup
import py2exe
setup(console=['Package.py'])
My program, in Package.py looks like this:
from PySide.QtCore import *
from PySide.QtGui import *
import sys
import Gui
class Ui_Dialog(QDialog, Gui.Ui_Dialog):
#Setupui and function afterwards generated converting XML file made by QT Desiner to python.
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(279, 295)
self.textBrowser = QtGui.QTextBrowser(Dialog)
self.textBrowser.setGeometry(QtCore.QRect(10, 10, 256, 192))
self.textBrowser.setObjectName("textBrowser")
self.pushButton = QtGui.QPushButton(Dialog)
self.pushButton.setGeometry(QtCore.QRect(10, 210, 251, 71))
self.pushButton.setObjectName("PushButton")
self.retranslateUi(Dialog)
QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL("clicked()"), self.textBrowser.clear)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Dialog", None, QtGui.QApplication.UnicodeUTF8))
self.pushButton.setText(QtGui.QApplication.translate("Dialog", "Clear Spam", None, QtGui.QApplication.UnicodeUTF8))
def __init__(self, parent=None):
super(Ui_Dialog, self).__init__(parent)
self.setupUi(self)
self.spam()
def spam(self):
self.textBrowser.append("SPAM")
self.textBrowser.append("SPAM")
self.textBrowser.append("SPAM")
self.textBrowser.append("LOL")
self.textBrowser.append("I")
self.textBrowser.append("AM")
self.textBrowser.append("SPAMMING")
self.textBrowser.append("MYSELF")
app = QApplication(sys.argv)
form = Ui_Dialog()
form.show()
app.exec_()
我正在运行安装了 32 位 python 和 32 位模块的 Windows 8。当我在命令提示符中运行 setup.py 时,setup.py 文件与 Package.py 位于同一文件夹中。除此之外,我不知道还有哪些其他信息可以帮助解决我的问题。
就是这样,感谢您提前提供任何答案。
【问题讨论】:
-
我现在也遇到了同样的问题,但没人能给出提示...
-
顺便找到解决办法了吗?
-
@foresightyj 我得到一个不同的错误,但来自同一位置,使用 Python 3.3.2 和 PySide 1.2.0。我在 Qt 论坛上发布了question,希望我们中的一个人能得到答案。
-
@Praetorian 我正在使用 Python 2.7.5。我还尝试登录并在 pyqt 的论坛上发布问题,但我能够找到一个可以开始新帖子的帖子......到目前为止,我的修复似乎工作正常。希望他们能尽快解决。
标签: python pyqt exe pyside py2exe