gpt4 book ai didi

python - 在雪豹上安装 psyco for python

转载 作者:行者123 更新时间:2023-12-04 12:43:08 28 4
gpt4 key购买 nike

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

我一直在尝试使用命令强制 python 在 32 位模式下运行

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

此外,我尝试了 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

最佳答案

在编译之前尝试这样做:
导出 ARCHFLAGS="-arch i386"
然后在 setup.py

代替
extra_link_args = [ ]

extra_link_args = [ '-L/开发者/SDKs/MacOSX10.6.sdk/usr/lib' ]

然后运行:
python setup.py 安装

希望这可以帮助!

关于python - 在雪豹上安装 psyco for python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5526092/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com