【问题标题】:Installing wxPython from source under linuxlinux下源码安装wxPython
【发布时间】:2011-11-26 21:10:54
【问题描述】:

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

  1. http://downloads.sourceforge.net/wxpython/wxPython-src-2.8.12.1.tar.bz2下载wxPython
  2. 运行./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
    
  3. make wxPython,它似乎运行没有错误。

  4. make install

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

所以我的问题是:

  1. 我是否缺少一些依赖项,尽管 wxPython 似乎可以构建和安装没有任何错误?
  2. 我在安装过程中是否遗漏了什么?
  3. 如何让 python 识别新包?

感谢任何提示、链接、文章。

【问题讨论】:

  • 你给了它一个自定义的安装目录,~/Local - 它在你的 Pythonpath 上吗?
  • @DanielRoseman 我将~/Local 添加到pythonpath 但import wx 仍然失败。

标签: python build dependencies wxpython installation


【解决方案1】:

对于 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 人。

【讨论】:

  • 感谢您对邮件列表的引用 :)
【解决方案2】:

我正在使用 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

【讨论】:

    猜你喜欢
    • 2014-08-13
    • 2011-10-22
    • 2018-02-02
    • 2020-10-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-23
    相关资源
    最近更新 更多