Skip to main content
 首页 » 编程设计

python之在linux下从源码安装wxPython

2025年05月04日11zhoujg

我正在尝试在 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. 安装

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

所以我的问题是:

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

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

请您参考如下方法:

对于 wxPython 2.8.x,这里有完整的源代码构建说明:

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

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

如果您遇到问题,请在此处加入 wxPython 用户邮件列表/Google 群组:http://wxpython.org/maillist.php

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