使用--arch x86_64选项编译sip时出现以下错误。
prosseek:siplib smcho$ python -c 'import sip; print sip' Traceback (most recent call last): File "", line 1, in ImportError: dlopen(./sip.so, 2): no suitable image found. Did find: ./sip.so: mach-o, but wrong architecture
我发现预先构建的Mac OS X python(snow leopard)是通用的,它没有64位的库。我想它是在32位模式下运行的。
file /usr/bin/python /usr/bin/python: Mach-O universal binary with 3 architectures /usr/bin/python (for architecture x86_64): Mach-O 64-bit executable x86_64 /usr/bin/python (for architecture i386): Mach-O executable i386 /usr/bin/python (for architecture ppc7400): Mach-O executable ppc
prosseek:siplib smcho$ file sip.so sip.so: Mach-O 64-bit bundle x86_64
如何强制python在64位模式下运行?当我在Textmate上运行相同的代码时,没有问题。所以,我认为Textmate应该在64位模式下运行。
好吧,当你这样做的时候要非常小心,它需要其他的东西也是64位的。突然之间,如果mod_python不起作用,那么您需要重新编译apache。然后是所有的python模块,比如tkinter/tix。如果你和我一样在10.5频道,不要去那里,只要用32位就行了。
如果你不知道http://www.macports.org/那就记住那是你的朋友。:-)
尝试使用arch(1),并提供特定版本的Python:
实际上,系统应该为您选择第一个合适的体系结构。作为
如果
python
以某种方式选择2.5,则不能使用64位,但如果它选择2.6,则应自动选择x86_64变量,如下所述。如果是前者,请尝试获取python_select
,并将版本更改为2.6。相关问题 更多 >
编程相关推荐