为 python 32 位安装另一个 wxpython

install another wxpython for python 32bit

我 运行 在我的 mac 上安装了 2 个 python 2.7。第一个是 python 64 字节,其中安装了 wxpython,第二个 python 是 32 字节,我也想安装 wxpython。 请注意,我的别名例如默认 python 运行 32 字节的一个和 运行 python64 starts 64 字节的安装

运行 brew 肯定检测到我的旧安装

brew install wxpython
Warning: wxpython-3.0.2.0 already installed

正在从 here generates the following weird error upon installation

下载二进制 .dmg 文件

最后我尝试通过下载 .tar 包和 运行 下面的内容来自己编译 wxpython。请注意,python 命令将所需的 32 个字节称为一个。

python build-wxpython.py --osx_cocoa --build_dir=../bld --install

经过几分钟的编译,我得到了以下错误

Error building
ERROR: failed building wxWidgets
Traceback (most recent call last):
  File "build-wxpython.py", line 389, in <module>
    wxbuild.main(wxscript, build_options)
  File "/Users/me/Downloads/wxPython-src-3.0.2.0/build/tools/build-wxwidgets.py", line 485, in main
    exitIfError(wxBuilder.build(dir=buildDir, options=args), "Error building")
  File "/Users/me/Downloads/wxPython-src-3.0.2.0/build/tools/build-wxwidgets.py", line 80, in exitIfError
    raise builder.BuildError(msg)
BuildError

通过回溯错误,错误的根源如下

/Users/me/Downloads/wxPython-src-3.0.2.0/src/osx/webview_webkit.mm:936:25: error: cannot initialize a variable of type
      'WebBackForwardList *' with an rvalue of type 'WKBackForwardList *'
    WebBackForwardList* history = [m_webView backForwardList];
                        ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/me/Downloads/wxPython-src-3.0.2.0/src/osx/webview_webkit.mm:954:25: error: cannot initialize a variable of type
      'WebBackForwardList *' with an rvalue of type 'WKBackForwardList *'
    WebBackForwardList* history = [m_webView backForwardList];
                        ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~

知道现在要做什么吗?

有一个 wxPython 的预发布版本,使用较新的 OSX 安装程序包格式,可在 https://wxpython.org/snapshots/ 获得。其中的二进制文件是多架构的,应该支持 Python 2.7 的 32 位和 64 位版本。如果您想将它与 Pythons 一起使用,而不是 Apple 的或从 python.org 安装的一个,那么您可以将 wxredirect.pth 文件复制到那个 Python 的 site-packages文件夹,如果它是与股票 Python 兼容的版本,那么它可能会正常工作。