Python wxPython install on MacOS X 10.8.x
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:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/wxPython-unicode-18.104.22.168/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.