在 Ubuntu 12.10 中安装 wxPython [英] Installing wxPython in Ubuntu 12.10

查看:39
本文介绍了在 Ubuntu 12.10 中安装 wxPython的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的 Ubuntu 12.10 上安装 wxPython,但没有成功.我已经浏览了本网站上给出的所有答案.有人可以在这方面帮助我或为我指明正确的方向.

I am trying to install wxPython on my Ubuntu 12.10 but with no success. I have gone through all the answers given on this website. Can someone please help me in this or point me in the right direction.

最初,我尝试了 http://wxpython.org/BUILD.html 但后来我来到了知道它在存储库中,我运行了sudo apt-get install install python-wxgtk2.8",它安装没有任何错误,但是当我运行它时,它仍然不可用.我想我在运行步骤中做了一些事情.

Initially, I tried http://wxpython.org/BUILD.html but then I came to know that it is in the repository, I ran "sudo apt-get install install python-wxgtk2.8", it installed without any error but then, when I run it, it is still unavailable. I guess I am doing something in the running step.

另外,虽然它在 Eclipse 中使用 PyDev 工作,但我收到了这个警告LIBDBUSMENU-GLIB-WARNING **:试图删除一个不相信我们是它的父母的孩子."" 关闭应用程序后状态栏也不起作用,

Also, although it is working in Eclipse using PyDev, but I am getting this warning " LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent."" after I close the application and the status bar is also not working,

这是我的代码:

import wx

class naman(wx.Frame):
    def __init__(self,parent,id):  # @ReservedAssignment
        wx.Frame.__init__(self,parent,id,'Frame aka Window', size=(300,200))
        panel=wx.Panel(self)

        statusbar=self.CreateStatusBar()
        menubar=wx.MenuBar()
        first=wx.Menu()
        second=wx.Menu()
        first.Append(wx.NewId(),"New Window", "This opens a new window")
        first.Append(wx.NewId(),"Open...", "This will open")
        second.Append(wx.NewId(),"Undo", "This will undo")
        second.Append(wx.NewId(),"Redo", "This will redo")
        menubar.Append(first,"File")
        menubar.Append(second,"Edit")
        self.SetMenuBar(menubar)
    if __name__=='__main__':
    app=wx.PySimpleApp()
    frame=naman(parent=None,id=-1)
    frame.Show()
    app.MainLoop()

如果有人能告诉我为什么我收到这个警告以及为什么状态栏不起作用,那也太棒了!!然后,我可以继续在 eclipse 本身中工作,不用担心 wxPython.

If someone can tell why I am getting this warning and why status bar is not working, that would be great too!! Then, I can continue working in eclipse itself and don't bother about wxPython.

PS:我已经安装了 Python2.7 和 Python3.3.

PS: I have Python2.7 and Python3.3 already installed.

提前致谢.

推荐答案

您需要安装 wxPython Phoenix,而不是 2.8.2.8 系列和 2.9 Classic 系列仅兼容 Python 2.x.您必须获取一个 Phoenix 快照来构建,因为它是唯一与 Python 3 兼容的版本.你可以在这里得到一个:

You need to install wxPython Phoenix, not 2.8. The 2.8 series and the 2.9 Classic series are only Python 2.x compatible. You'll have to grab a Phoenix snapshot to build against as it is the only version that is Python 3 compatible. You can get one here:

请注意,Phoenix 是非常测试版的,因为它目前仅支持核心小部件.大多数自定义小部件,如 wx.lib 中的那些,仍在移植中.有关详细信息,请参阅 http://wiki.wxpython.org/ProjectPhoenix.

Note that Phoenix is very beta in that it only supports the core widgets currently. Most of the custom widgets, like those in wx.lib, are still being ported. See http://wiki.wxpython.org/ProjectPhoenix for more information.

这篇关于在 Ubuntu 12.10 中安装 wxPython的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆