我在运行一个叫pyPENELOPE的软件时遇到了问题。完美安装后,我试着运行该软件并收到错误
Traceback (most recent call last):
File "/usr/bin/pypenelope", line 6, in <module>
from penelopetools.gui.main import run
File "/usr/share/python-penelope/penelopetools/gui/main.py", line 52, in <module>
from wxtools.statusbar import EnhancedStatusBar
File "/usr/share/python-penelope/wxtools/statusbar.py", line 72, in <module>
class EnhancedStatusBar(wx.StatusBar):
File "/usr/share/python-penelope/wxtools/statusbar.py", line 74, in EnhancedStatusBar
def __init__(self, parent, id=wx.ID_ANY, style=wx.ST_SIZEGRIP,
AttributeError: 'module' object has no attribute 'ST_SIZEGRIP'
搜索时,我发现问题可能出在代码中的这个调用中
import wx
我需要把线放好
import wxversion
wxversion.select('2.8')
import wx
但是我已经收到消息了
wxversion.select('2.8')
File "/usr/lib/python2.7/dist-packages/wxversion.py", line 144, in select
raise AlreadyImportedError("wxversion.select() must be called before wxPython is imported")
wxversion.AlreadyImportedError: wxversion.select() must be called before wxPython is imported
在我收到的import wxversion
之前调用wxversion.select('2.8')
File "/usr/share/python-penelope/wxtools/statusbar.py", line 48, in <module>
wxversion.select('2.8')
NameError: name 'wxversion' is not defined
所以。。。。我能做什么
如果像我一样,您正在使用python3作为pyPENELOPE,您可以删除wxversion行,改为将ST_SIZEGRIP更改为STB_SIZEGRIP,您的代码应该可以编译
祝你好运, 兔子
相关问题 更多 >
编程相关推荐