Search code examples
python-2.7wxpython

install another wxpython for python 32bit


I am running 2 installations of python 2.7 on my mac. the first one is python 64 bytes where wxpython is installed and the second python is 32 bytes where I also want to install wxpython. note that my aliases are such as the default python runs the 32 bytes one and running python64 starts the 64 bytes installation

running brew definitely detects my old installation

brew install wxpython
Warning: wxpython-3.0.2.0 already installed

downloading a binary .dmg file from here generates the following weird error upon installationenter image description here

At the end I tried to compile wxpython myself by downloading the .tar package and running the following. Note that python command calls the wanted 32 bytes one.

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

after minutes of compilations I got the following error

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

by tracing back the error, the origin of the error is the following

/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];
                        ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~

Any idea on what to do now ?


Solution

  • There is a prerelease build of wxPython using the newer OSX Installer package format, available at https://wxpython.org/snapshots/. The binaries therein are multi-architecture and should support both 32-bit and 64-bit versions of Python 2.7. If you want to use it with Pythons other than Apple's or one installed from python.org then you can copy the wxredirect.pth file to that Python's site-packages folder and if it is a build compatible with the stock Python then it will likely work okay.