【发布时间】:2013-03-24 21:31:59
【问题描述】:
当我尝试import regex 时出现以下错误。
Traceback (most recent call last):
File "app.py", line 3, in <module>
import regex
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/regex.py", line 391, in <module>
import _regex_core
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/_regex_core.py", line 21, in <module>
import _regex
ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/_regex.so, 2): no suitable image found. Did find:
/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/_regex.so: mach-o, but wrong architecture
我已经通过 macports 安装了 python33,然后通过 sudo python setup.py install 安装了最新版本的正则表达式(Matthew Barnett)。
我正在使用 Mac Os X Leopard (8.5)。我的处理器是 64 位的 Core 2 Duo。我该如何解决这个错误?
当我运行lipo -info 时,我得到:
Non-fat file: /opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/_regex.so is architecture: i386
当我运行lipo -info /opt/local/bin/python
非胖文件:/opt/local/bin/python 是架构:ppc7400
为什么是python ppc7400?
【问题讨论】:
-
您确定您使用的是 3.3 python 二进制文件吗?
-
查看库路径:这强烈表明 Python 3.3 正在运行。
-
当我在终端上运行 python 时,我得到: Python 3.3.0 (default, Mar 24 2013, 16:14:43) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin 键入“help”、“copyright”、“credits”或“license”以获取更多信息。 >>>
标签: python macos macports osx-leopard python-3.3