2011-04-02 192 views
7

我在使用python 2.6.1运行Snow Leopard的Macbook pro上安装psyco时遇到了一些问题。在Snow Leopard上安装psyco for python

我一直试图迫使蟒蛇使用命令

defaults write com.apple.versioner.python Prefer-32-Bit -bool yes 

此外,在32位模式下运行,我已经试过了Macport py26-Psyco的,这似乎完成,但模块不能被发现编译时。

$ sudo python setup.py install
PROCESSOR = 'ivm'
running install
running build
running build_py
running build_ext
building 'psyco._psyco' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -DALL_STATIC=1 -Ic/ivm -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c c/psyco.c -o build/temp.macosx-10.6-universal-2.6/c/psyco.o
In file included from c/initialize.h:48,
from c/psyco.c:14:
c/psyfunc.c: In function ‘psycofunction_call’:
c/psyfunc.c:801: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
In file included from c/initialize.h:49,
from c/psyco.c:14:
c/stats.c: In function ‘psyco_stats_reset’:
c/stats.c:260: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
c/stats.c: In function ‘psyco_stats_dump’:
c/stats.c:298: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
c/stats.c: In function ‘psyco_stats_top’:
c/stats.c:326: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
In file included from c/initialize.h:75,
from c/psyco.c:14:
c/Objects/pstructmember.c: In function ‘PsycoMember_GetOne’:
c/Objects/pstructmember.c:16: warning: unused variable ‘w2’
c/psyco.c: At top level:
c/codegen.c:748: warning: ‘integer_lshift’ defined but not used
c/ivm/prolog/insns-igen.i:175: warning: ‘psyco_insn_assertdepth’ defined but not used
c/ivm/prolog/insns-igen.i:197: warning: ‘psyco_insn_dynamicfreq’ defined but not used
c/codegen.c:66: warning: ‘cc_from_vsource’ defined but not used
c/Objects/plongobject.c:20: warning: ‘PsycoLong_AsDouble’ defined but not used
c/Objects/plistobject.c:116: warning: ‘PsycoList_SingletonNew’ defined but not used
c/codegen.c: In function ‘psyco_generic_call’:
c/codegen.c:423: warning: ‘_arg’ may be used uninitialized in this function
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
In file included from c/initialize.h:48,
from c/psyco.c:14:
c/psyfunc.c: In function ‘psycofunction_call’:
c/psyfunc.c:801: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
In file included from c/initialize.h:49,
from c/psyco.c:14:
c/stats.c: In function ‘psyco_stats_reset’:
c/stats.c:260: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
c/stats.c: In function ‘psyco_stats_dump’:
c/stats.c:298: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
c/stats.c: In function ‘psyco_stats_top’:
c/stats.c:326: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
In file included from c/initialize.h:75,
from c/psyco.c:14:
c/Objects/pstructmember.c: In function ‘PsycoMember_GetOne’:
c/Objects/pstructmember.c:16: warning: unused variable ‘w2’
c/psyco.c: At top level:
c/codegen.c:748: warning: ‘integer_lshift’ defined but not used
c/ivm/prolog/insns-igen.i:175: warning: ‘psyco_insn_assertdepth’ defined but not used
c/ivm/prolog/insns-igen.i:197: warning: ‘psyco_insn_dynamicfreq’ defined but not used
c/codegen.c:66: warning: ‘cc_from_vsource’ defined but not used
c/Objects/plongobject.c:20: warning: ‘PsycoLong_AsDouble’ defined but not used
c/Objects/plistobject.c:116: warning: ‘PsycoList_SingletonNew’ defined but not used
c/codegen.c: In function ‘psyco_generic_call’:
c/codegen.c:423: warning: ‘_arg’ may be used uninitialized in this function
c/psyco.c: At top level:
c/psyco.c:1064: fatal error: error writing to -: Broken pipe
compilation terminated.
In file included from c/psyco.c:1:
c/psyco.h:13:3: error: #error "64-bit systems not supported at all. See help on psyco.sf.net"
In file included from c/dispatcher.h:10,
from c/codemanager.h:10,
from c/psyco.c:3:
c/vcompiler.h: In function ‘PsycoObject_New’:
c/vcompiler.h:743: warning: comparison is always false due to limited range of data type
c/vcompiler.h: In function ‘PsycoObject_Resize’:
c/vcompiler.h:757: warning: comparison is always false due to limited range of data type
In file included from c/dispatcher.h:12,
from c/codemanager.h:10,
from c/psyco.c:3:
c/codegen.h:15:3: error: #error "-----------------------------------------------------"
c/codegen.h:16:3: error: #error "Sorry, non-32-bit platforms are not supported at all."
c/codegen.h:17:3: error: #error "You may try with a Python compiled in 32-bit "
c/codegen.h:18:3: error: #error "compatibility mode. Note that Psyco will probably "
c/codegen.h:19:3: error: #error "never support non-32-bit platforms, as it is no "
c/codegen.h:20:3: error: #error "longer actively developed. Instead, the PyPy group "
c/codegen.h:21:3: error: #error "plans to replace it with a more flexible and easily "
c/codegen.h:22:3: error: #error "retargettable Psyco-for-PyPy during the year 2006. "
c/codegen.h:23:3: error: #error "See http://codespeak.net/pypy/ "
c/codegen.h:24:3: error: #error "-----------------------------------------------------"
In file included from c/ivm/iinitialize.h:12,
from c/initialize.h:42,
from c/psyco.c:14:
c/ivm/idispatcher.c: In function ‘psyco_unify’:
c/ivm/idispatcher.c:202: warning: comparison is always false due to limited range of data type
In file included from c/initialize.h:46,
from c/psyco.c:14:
c/dispatcher.c: In function ‘fz_internal_copy’:
c/dispatcher.c:131: warning: comparison is always false due to limited range of data type
c/dispatcher.c: In function ‘fz_compress’:
c/dispatcher.c:233: warning: cast from pointer to integer of different size
c/dispatcher.c:239: warning: cast to pointer from integer of different size
In file included from c/initialize.h:48,
from c/psyco.c:14:
c/psyfunc.c: In function ‘psycofunction_call’:
c/psyfunc.c:801: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
In file included from c/initialize.h:49,
from c/psyco.c:14:
c/stats.c: In function ‘psyco_stats_reset’:
c/stats.c:260: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
c/stats.c: In function ‘psyco_stats_dump’:
c/stats.c:298: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
c/stats.c: In function ‘psyco_stats_top’:
c/stats.c:326: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
In file included from c/initialize.h:53,
from c/psyco.c:14:
c/codemanager.c: In function ‘psyco_shrink_code_buffer’:
c/codemanager.c:235: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long int’
In file included from c/initialize.h:60,
from c/psyco.c:14:
c/Objects/pobject.c: In function ‘getdictoffset’:
c/Objects/pobject.c:257: error: ‘SIZE_OF_LONG_BITS’ undeclared (first use in this function)
c/Objects/pobject.c:257: error: (Each undeclared identifier is reported only once
c/Objects/pobject.c:257: error: for each function it appears in.)
In file included from c/initialize.h:61,
from c/psyco.c:14:
c/Objects/pabstract.c:723:3: error: #error "omitted code from Python 2.3 here"
In file included from c/initialize.h:75,
from c/psyco.c:14:
c/Objects/pstructmember.c: In function ‘PsycoMember_GetOne’:
c/Objects/pstructmember.c:16: warning: unused variable ‘w2’
lipo: can't open input file: /var/tmp//ccjHgyCU.out (No such file or directory)
error: command 'gcc-4.2' failed with exit status

回答

0

我没有回答你的问题,但作为替代,你有没有尝试从源代码安装,详见herehere?

此外,您可以强制32位蟒蛇,以及由调用终端中的命令python2.6-32,这对于测试目的可能更方便一些。

2

尝试编译之前这样做: 出口ARCHFLAGS = “ - 拱i386的” 然后在setup.py

更换 extra_link_args = [] 与 extra_link_args = ['-L/Developer /SDKs/MacOSX10.6.sdk/usr/lib”]

然后只需运行: 蟒蛇的setup.py安装

希望这有助于!

+0

这是为我做的!谢谢! – 2011-07-22 08:54:27

1

我在使用OS X 10.7的MacBook Pro上遇到了同样的问题。

我能够使用它“命令的python2.5的setup.py安装”编译

不是它的工作就像魅力。希望这可以帮助别人。