I spent a very unpleasant evening trying to get wxpythonmy MacBook Pro to work (Snow Leopard 10.6.6 works). From reading various topics on this topic both here and on other sites, this is my understanding so far:
- If you are using python 2.6 or higher, you can only work with wxpython if you are accessing the 32-bit version
- Entering
pythonthe command line shows what I'm using python 2.6.1. - Input
which pythonreturns /usr/bin/python, so I use the default version installed with my OS. This means that at the command prompt, enter the following command:
defaults write com.apple.versioner.python Prefer-32-Bit -bool yesshould change the version I'm using for the 32-bit version. - With the above, I can now simply enter the name of my python file (with the imported module
wx), and my file will run successfully.
As you can undoubtedly guess, however, my file does not work successfully. I canβt understand whatβs going on, but maybe someone else can see other observations here that might help ...
typing help(), modulesdisplays the following message and then outputs modules, including wxandwxpython
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/pkgutil.py:110: DeprecationWarning: The wxPython compatibility package is no longer automatically generated or actively maintained. Please switch to the wx package as soon as possible.
__import__(name)
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/pkgutil.py:110: DeprecationWarning: twisted.flow is unmaintained.
__import__(name)
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/twisted/python/filepath.py:12: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
import sha
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/twisted/words/im/__init__.py:8: UserWarning: twisted.im will be undergoing a rewrite at some point in the future.
warnings.warn("twisted.im will be undergoing a rewrite at some point in the future.")
Fri Jun 3 22:23:48 Paul-Pattersons-MacBook-Pro.local python[3208] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
Then studying the module wxspecifically gives ...
NAME wx
FILE /usr/local/lib/wxPython-unicode-2.8.12.0/lib/python2.6/site-packages/wx-2.8-mac-unicode/wx/__init__.py
Can anyone help?