Install wxPython on Mac os Mavericks

2020-02-09 09:42发布

问题:

I am on a Macbook Air, running Mavericks. Today I downloaded wxPython via their website, however, when I click on the install package I get:

wxPython3.0-osx-cocoa-py2.7.pkg” is damaged and can’t be opened. You should eject the disk image.

Anyone have any ideas to get around this, thanks.

回答1:

According to #14523, the problem is that the package is not signed (and it's an old-style package, which isn't fully supported anymore, which is why you get the wrong error message, and the usual workaround of context-clicking Open doesn't work).

There are two workarounds:

First, you can turn off Gatekeeper (in System Preferences, Security & Privacy, General, select the "Allow apps downloads from: … Anywhere" radio button), install wxPython, then turn Gatekeeper back on.

Alternatively, you can install from the command line:

sudo installer -pkg /path/to/wxPython.pkg -target /


回答2:

As with so many other packages, install wxpython with brew:

brew install wxpython

I hit this problem with El Capitan (10.11.2) and tried some of the workarounds mentioned elsewhere (install via command-line, allow installation of unsigned apps, etc) with no luck. Use brew!



回答3:

The accepted answer didn't work for me on macOS Sierra.

I had to manually repackage the the original package as described here: https://trac.wxwidgets.org/ticket/17203#comment:8



回答4:

Use brew* to install wxmac using the following command.

brew install --python wxmac --devel

once you install the wxmac create a symbolic link between the installed wx to the python library.

sudo ln -s /usr/local/Cellar/wxmac/2.9.4.0/lib/python2.7/site-packages/wx /Library/Python/2.7/site-packages/wx

I Hope it will be helpful for future installers.

*if you do not have Brew installed prior, install it using the following command: ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"