在linux下从源代码安装wxPython

时间:2011-09-28 13:13:31

标签: python build dependencies wxpython install

我正在尝试从linux下的源代码安装wxPython。我遵循的步骤是:

  1. http://downloads.sourceforge.net/wxpython/wxPython-src-2.8.12.1.tar.bz2
  2. 下载wxPython
  3. 运行./configure --prefix=$HOME/Local
    在配置过程结束时,输出为:

    Configured wxWidgets 2.8.12 for `x86_64-unknown-linux-gnu'
    
      Which GUI toolkit should wxWidgets use?                 GTK+ 2
      Should wxWidgets be compiled into single library?       no
      Should wxWidgets be compiled in debug mode?             no
      Should wxWidgets be linked as a shared library?         yes
      Should wxWidgets be compiled in Unicode mode?           no
      What level of wxWidgets compatibility should be enabled?
                                           wxWidgets 2.4      no
                                           wxWidgets 2.6      yes
      Which libraries should wxWidgets use?
                                           jpeg               sys
                                           png                sys
                                           regex              sys
                                           tiff               builtin
                                           zlib               sys
                                           odbc               no
                                           expat              builtin
                                           libmspack          no
                                           sdl                no
    
  4. make wxPython,似乎没有错误地运行。

  5. make install
  6. 但是当我现在尝试在python控制台(v2.7)中执行import wx时,python找不到该模块。

    所以我的问题是:

    1. 虽然wxPython似乎没有任何错误地构建和安装,但我错过了一些依赖项吗?
    2. 我在安装过程中是否遗漏了什么?
    3. 如何让python知道新包?
    4. 任何提示,链接,文章表示赞赏。

2 个答案:

答案 0 :(得分:2)

对于wxPython 2.8.x,这里有来自源指令的完整构建:

http://wxpython.org/BUILD-2.8.html

如果您更愿意使用2.9,那么您可以改用以下说明:http://wxpython.org/builddoc.php

如果您遇到问题,请在此处加入wxPython-users邮件列表/ Google网上论坛:http://wxpython.org/maillist.php

告诉他们你正在使用哪些版本的wxPython和Python以及哪些Linux,你几乎肯定会得到帮助。那里有很多Linux人员。

答案 1 :(得分:-3)

我正在使用python 2.7在centos机器上安装WxPython 3.0。

即使使用disable-mediactrl,安装也会搜索GSTreamer并提供错误 "configure: error: GStreamer not available"尽管GSTreamer可以在机器上使用。

以下是两个此类构建的详细信息:

我的想法是关闭mediactrl,所以我使用以下选项

python build-wxpython.py --extra_setup=disable-mediactrl  --build_dir=../bld

python build-wxpython.py --extra_setup="--disable-mediactrl  --build_dir=../bld

但是,它仍会搜索GSTreamer并输出下面列出的错误消息。 我重新安装了GSTreamer 0.10并进入\ usr \ lib \ GSTreamer 0.10,但是,我收到了同样的错误信息

错误消息:

checking what is the type of the third argument of getsockname... socklen_t
checking what is the type of the fifth argument of getsockopt... socklen_t
checking for linux/joystick.h... yes
checking for python... /home/aptRoot/tools/python/64/Python-2.7/bin/python
checking for WEBKIT... configure: WARNING: webkitgtk not found.
configure: WARNING: WebKit not available, disabling wxWebView
checking for CAIRO... yes
checking for cairo_push_group... yes
checking for GST... configure: WARNING: GStreamer 0.10 not available, falling back to 0.8
checking for GST... configure: WARNING: GStreamer 0.8/0.10 not available.
configure: error: GStreamer not available
Error running configure
ERROR: failed building wxWidgets
Traceback (most recent call last):
  File "build-wxpython.py", line 378, in <module>
    wxbuild.main(wxscript, build_options)
  File "/home/hemadris/iAPT/install/wxPython-src-3.0.0.0/build/tools/build-wxwidgets.py", line 364, in main
    "Error running configure")
  File "/home/hemadris/iAPT/install/wxPython-src-3.0.0.0/build/tools/build-wxwidgets.py", line 80, in exitIfError
    raise builder.BuildError(msg)
BuildError