Python wxPython install on MacOS X 10.8.x

Share this post:

wxPython is a GUI library kit for developing desktop application with Python. Since it is cross-platform you can actually run your code on MacOS X, Windows and Linux.

Now, while installing wxPython on my development environment (MacBook Air 13″, MacOS X 10.8.x) and the standard installer from the wxPython website I’ve hit an error already by simply importing the wx library. The error was:

[code]import wx
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/__init__.py", line 45, in <module>
from wx._core import *[/code]

Now, whatever I tried, did not work, until I remembered that I install all my apps with “brew”. Ok, so off I went to find the correct installer arguments for wxPython. To my surprise it wasn’t really public and so here is the correct installer argument for getting wxPython up and running with Brew:

[code]brew install –python wxmac –devel[/code]

This will install and link everything perfectly and now wxPython can be imported successfully. Please note; I also use the Python version from Brew, so your experience might be different if you want to use the one coming with MacOS X.

Over 10 years in business.

Self-funded. No investors. No bullshit.

More than 3,000 customers worldwide.

Helpmonks - no bullshit customer engagement service

Growth starts with action

Empower your team and delight your customers.

Helpmonks - email management for small businesses