1. Try to install wxpython today and enter Python and import wx. the following error is returned:
File "guitest. py", line 2, in <module>
Import WX
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 *
File "/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/Site-packages/wx-2.8-mac-unicode/wx/_ core. py", line 4, in <module>
Import _ core _
Importerror: dlopen (/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/Site-packages/wx-2.8-mac-unicode/wx/_ core _. so, 2): no suitable image found. did find:
/Usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/Site-packages/wx-2.8-mac-unicode/wx/_ core _. So: no matching architecture in universal wrapper
If you run Python-32 and then import wx, no error will be reported!
At first glance, we know that wx is 32-bit! For the mountain lion at this time, 64 is the system!
There are many solutions!
Finally, I searched by Google: Download a wxpython Based on the cocoa API, so you don't have to worry about the architecture.
:
Wxpython 2.9: http://downloads.sourceforge.net/wxpython/wxPython2.9-osx-2.9.4.0-cocoa-py2.7.dmg
Finally, I ran a test code: the test was successful! :