Install wxPython 2.8 (For Ride) on OSX “El Capitan”

后端 未结 2 801
栀梦
栀梦 2021-01-31 23:55

I\'m trying to install wxPython 2.8 unicode version, to be able to use robotframework-ride.

So far the installer downloaded from the site failed with an error saying \"T

2条回答
  •  无人及你
    2021-02-01 00:20

    I ran into the same error:

    $ sudo installer -pkg /Volumes/wxPython2.9-osx-2.9.5.0-cocoa-py2.7/wxPython2.9-osx-cocoa-py2.7.pkg/ -target /
    installer: Package name is wxPython2.9-osx-cocoa-py2.7
    installer: Installing at base path /
    2015-10-19 11:27:48.417 installer[875:22541] Package /Volumes/wxPython2.9-osx-2.9.5.0-cocoa-py2.7/wxPython2.9-osx-cocoa-py2.7.pkg uses a deprecated pre-10.2 format (or uses a newer format but is invalid).
    installer: The install failed (The Installer could not install the software because there was no software found to install.)
    

    As you may know, on OS X, RIDE supports both wxPython 2.8 and 2.9, and that's why I'm using v2.9 here:

    try:
        import wxversion
        from wxversion import VersionError
        if sys.platform == 'darwin': # CAN NOT IMPORT IS_MAC AS THERE IS A wx IMPORT
            wxversion.select(['2.8', '2.9'])
        else:
            wxversion.select('2.8')
    except ImportError:
        print "wxPython not found."
    

    Although wxmac formula can be used to install wxPython 2.9.5.0, but on OS X 10.11 El Capitan, you'll encounter the following error reported in #16329 while building wxWidgets.

    So, we have to build it from (modified) source code:

    1. Install Xcode, and download wxPython-src-2.9.5.0.tar.bz2.

    2. Extract the tarball and replace #include (in src/osx/webview_webkit.mm) with #include .

    Then follow the instructions described in wxmac formula to build and install wxPython:

    $ cd wxPython-src-2.9.5.0
    $ PREFIX=/usr/local
    $ ./configure --prefix=$PREFIX --enable-shared --enable-monolithic --enable-unicode --enable-std_string --enable-display --with-opengl --with-osx_cocoa --with-libjpeg --with-libtiff --with-libpng --with-zlib --enable-dnd --enable-clipboard --enable-webkit --enable-svg --with-expat --with-macosx-version-min=10.11 --enable-universal_binary=i386,x86_64 --disable-precomp-headers
    $ sudo make install
    
    $ cd wxPython
    $ sudo python setup.py build_ext WXPORT=osx_cocoa WX_CONFIG=$PREFIX/bin/wx-config UNICODE=1 INSTALL_MULTIVERSION=1 BUILD_GLCANVAS=1 BUILD_GIZMOS=1 BUILD_STC=1
    
    $ sudo python setup.py install WXPORT=osx_cocoa WX_CONFIG=$PREFIX/bin/wx-config UNICODE=1 INSTALL_MULTIVERSION=1 BUILD_GLCANVAS=1 BUILD_GIZMOS=1 BUILD_STC=1
    

    To verify the installation:

    $ python
    >>> import wx
    >>>
    

    Note that this is a 64-bit setup, you don't have to run RIDE in 32-bit mode.

提交回复
热议问题