本文主要是介绍Mac OS X 10.7 Lion下import wx报错“no matching architecture in universal wrapper”的解决方法,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
一直一来在Lion下我就用不了wx,这样导致UliPad等等我都用不了,很伤脑筋,出错提示是这样:
Python 2.7.1 (r271:86882M, Nov 30 2010, 10:35:34)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
Traceback (most recent call last):File "<stdin>", line 1, in <module>File "/usr/local/lib/wxPython-unicode-2.8.11.0/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.11.0/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.11.0/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.11.0/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_core_.so: no matching architecture in universal wrapper
经过万能的谷歌,知道是32位和64位的问题。当试图用
python - 32
或者
python - 64
来使用的时候,出现下列错误提示:
Last login: Sat Sep 24 23:49:08 on ttys000
TookMacBook-Pro:~ tooktang$ python2.7 - 64
Python 2.7.1 (r271:86832, May 9 2011, 13:12:03)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.14.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 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 *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: /usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_core_.so: no appropriate 64-bit architecture (see "man python" for running in 32-bit mode)
>>>
还是用不了,最后干脆卸载了python,在官网上重新下载了for 10.3~10.6的dmg镜像(正好换成2.7.2,哈哈),也就是只有32位版本的,之后就可以用了:
这篇关于Mac OS X 10.7 Lion下import wx报错“no matching architecture in universal wrapper”的解决方法的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!