在 Snow Leopard 上安装 python psyco

发布于 2024-10-30 02:13:16 字数 6636 浏览 5 评论 0原文

我在使用 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
处理器 = 'ivm'
运行安装
运行构建
运行build_py
运行 build_ext
构建“psyco._psyco”扩展
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 -cc/psyco.c -o build/temp.macosx-10.6-universal-2.6/c/psyco.o
在 c/initialize.h:48 包含的文件中,
来自 c/psyco.c:14:
c/psyfunc.c:在函数“psycofunction_call”中:
c/psyfunc.c:801:警告:从不兼容的指针类型传递“PyDict_Next”的参数 2
在 c/initialize.h:49 包含的文件中,
来自 c/psyco.c:14:
c/stats.c:在函数“psyco_stats_reset”中:
c/stats.c:260:警告:从不兼容的指针类型传递“PyDict_Next”的参数 2
c/stats.c:在函数“psyco_stats_dump”中:
c/stats.c:298:警告:从不兼容的指针类型传递“PyDict_Next”的参数 2
c/stats.c:在函数“psyco_stats_top”中:
c/stats.c:326:警告:从不兼容的指针类型传递“PyDict_Next”的参数 2
在 c/initialize.h:75 包含的文件中,
来自 c/psyco.c:14:
c/Objects/pstructmember.c:在函数“PsycoMember_GetOne”中:
c/Objects/pstructmember.c:16:警告:未使用变量“w2”
c/psyco.c:顶层:
c/codegen.c:748:警告:已定义“integer_lshift”但未使用
c/ivm/prolog/insns-igen.i:175:警告:“psyco_insn_assertdepth”已定义但未使用
c/ivm/prolog/insns-igen.i:197:警告:“psyco_insn_dynamicfreq”已定义但未使用
c/codegen.c:66:警告:“cc_from_vsource”已定义但未使用
c/Objects/plongobject.c:20: 警告: 'PsycoLong_AsDouble' 已定义但未使用
c/Objects/plistobject.c:116:警告:“PsycoList_SingletonNew”已定义但未使用
c/codegen.c:在函数“psyco_generic_call”中:
c/codegen.c:423:警告:“_arg”可能在此函数中未初始化时使用
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as:汇编器(/usr/bin/../libexec/gcc/darwin/ppc/as 或 /usr/bin/../local/libexec /gcc/darwin/ppc/as) 未安装架构 ppc
安装的汇编器是:
/usr/bin/../libexec/gcc/darwin/x86_64/as 对于体系结构 x86_64
/usr/bin/../libexec/gcc/darwin/i386/as 用于架构 i386
在 c/initialize.h:48 包含的文件中,
来自 c/psyco.c:14:
c/psyfunc.c:在函数“psycofunction_call”中:
c/psyfunc.c:801:警告:从不兼容的指针类型传递“PyDict_Next”的参数 2
在 c/initialize.h:49 包含的文件中,
来自 c/psyco.c:14:
c/stats.c:在函数“psyco_stats_reset”中:
c/stats.c:260:警告:从不兼容的指针类型传递“PyDict_Next”的参数 2
c/stats.c:在函数“psyco_stats_dump”中:
c/stats.c:298:警告:从不兼容的指针类型传递“PyDict_Next”的参数 2
c/stats.c:在函数“psyco_stats_top”中:
c/stats.c:326:警告:从不兼容的指针类型传递“PyDict_Next”的参数 2
在 c/initialize.h:75 包含的文件中,
来自 c/psyco.c:14:
c/Objects/pstructmember.c:在函数“PsycoMember_GetOne”中:
c/Objects/pstructmember.c:16:警告:未使用变量“w2”
c/psyco.c:顶层:
c/codegen.c:748:警告:已定义“integer_lshift”但未使用
c/ivm/prolog/insns-igen.i:175:警告:“psyco_insn_assertdepth”已定义但未使用
c/ivm/prolog/insns-igen.i:197:警告:“psyco_insn_dynamicfreq”已定义但未使用
c/codegen.c:66:警告:“cc_from_vsource”已定义但未使用
c/Objects/plongobject.c:20: 警告: 'PsycoLong_AsDouble' 已定义但未使用
c/Objects/plistobject.c:116:警告:“PsycoList_SingletonNew”已定义但未使用
c/codegen.c:在函数“psyco_generic_call”中:
c/codegen.c:423:警告:在此函数中可能会使用未初始化的“_arg”
c/psyco.c:顶层:
c/psyco.c:1064:致命错误:写入时出错 -:管道损坏
编译终止。
在 c/psyco.c:1 包含的文件中:
c/psyco.h:13:3:错误:#error“根本不支持 64 位系统。请参阅 psyco.sf.net 上的帮助”
在 c/dispatcher.h:10 包含的文件中,
来自 c/codemanager.h:10,
来自 c/psyco.c:3:
c/vcompiler.h:在函数“PsycoObject_New”中:
c/vcompiler.h:743: 警告:由于数据类型范围有限,比较始终为 false
c/vcompiler.h:在函数“PsycoObject_Resize”中:
c/vcompiler.h:757: 警告:由于数据类型范围有限,比较始终为 false
在 c/dispatcher.h:12 包含的文件中,
来自 c/codemanager.h:10,
来自 c/psyco.c:3:
c/codegen.h:15:3: 错误: #error "------------------------------------------------ ------------------》
c/codegen.h:16:3: error: #error“抱歉,根本不支持非 32 位平台。”
c/codegen.h:17:3: 错误:#error“您可以尝试使用 32 位编译的 Python”
c/codegen.h:18:3: 错误:#error“兼容模式。请注意,Psyco 可能会”
c/codegen.h:19:3: 错误:#error“从不支持非 32 位平台,因为它不是”
c/codegen.h:20:3:错误:#error“不再积极开发。相反,PyPy 组”
c/codegen.h:21:3: 错误:#error“计划将其替换为更灵活、更容易的”
c/codegen.h:22:3:错误:#error“2006 年可重新定位 Psyco-for-PyPy。”
c/codegen.h:23:3:错误:#error“请参阅http://codespeak.net/pypy/
c/codegen.h:24:3: 错误: #error "------------------------------------ ------------------》
在 c/ivm/iinitialize.h:12 包含的文件中,
来自 c/initialize.h:42,
来自 c/psyco.c:14:
c/ivm/idispatcher.c:在函数“psyco_unify”中:
c/ivm/idispatcher.c:202:警告:由于数据类型范围有限,比较始终为 false
在 c/initialize.h:46 包含的文件中,
来自 c/psyco.c:14:
c/dispatcher.c:在函数“fz_internal_copy”中:
c/dispatcher.c:131:警告:由于数据类型范围有限,比较始终为 false
c/dispatcher.c:在函数“fz_compress”中:
c/dispatcher.c:233:警告:从指针转换为不同大小的整数
c/dispatcher.c:239:警告:从不同大小的整数转换为指针
在 c/initialize.h:48 包含的文件中,
来自 c/psyco.c:14:
c/psyfunc.c:在函数“psycofunction_call”中:
c/psyfunc.c:801:警告:从不兼容的指针类型传递“PyDict_Next”的参数 2
在 c/initialize.h:49 包含的文件中,
来自 c/psyco.c:14:
c/stats.c:在函数“psyco_stats_reset”中:
c/stats.c:260:警告:从不兼容的指针类型传递“PyDict_Next”的参数 2
c/stats.c:在函数“psyco_stats_dump”中:
c/stats.c:298:警告:从不兼容的指针类型传递“PyDict_Next”的参数 2
c/stats.c:在函数“psyco_stats_top”中:
c/stats.c:326:警告:从不兼容的指针类型传递“PyDict_Next”的参数 2
在 c/initialize.h:53 包含的文件中,
来自 c/psyco.c:14:
c/codemanager.c:在函数“psyco_shrink_code_buffer”中:
c/codemanager.c:235: 警告:格式“%d”需要类型“int”,但参数 3 的类型为“long int”
在 c/initialize.h:60 包含的文件中,
来自 c/psyco.c:14:
c/Objects/pobject.c:在函数“getdictoffset”中:
c/Objects/pobject.c:257: 错误:'SIZE_OF_LONG_BITS' 未声明(在此函数中首次使用)
c/Objects/pobject.c:257: 错误:(每个未声明的标识符仅报告一次
c/Objects/pobject.c:257: 错误:对于它出现的每个函数。)
在 c/initialize.h:61 包含的文件中,
来自 c/psyco.c:14:
c/Objects/pabstract.c:723:3:错误:#error“此处省略了 Python 2.3 中的代码”
在 c/initialize.h:75 包含的文件中,
来自 c/psyco.c:14:
c/Objects/pstructmember.c:在函数“PsycoMember_GetOne”中:
c/Objects/pstructmember.c:16:警告:未使用的变量“w2”
lipo: 无法打开输入文件: /var/tmp//ccjHgyCU.out (没有这样的文件或目录)
错误:命令“gcc-4.2”失败并退出状态

I'm having some trouble installing psyco on my Macbook pro running Snow Leopard with python 2.6.1.

I've been trying to force python to run in 32-bit mode using the command

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

Further, I have tried the Macport py26-psyco, which seems to finish but the module cannot be found when compiling.

$ 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

玉环 2024-11-06 02:13:16

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

替换
额外链接参数 = [ ]

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

然后运行:
python setup.py install

希望这有帮助!

Try doing this before compiling:
export ARCHFLAGS="-arch i386"
then in the setup.py

replace
extra_link_args = [ ]
with
extra_link_args = [ '-L/Developer/SDKs/MacOSX10.6.sdk/usr/lib' ]

then just run:
python setup.py install

Hope this helps!

萌梦深 2024-11-06 02:13:16

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

我能够使用“sudo python2.5 setup.py install”来编译它,

但它的工作原理并不像魅力。希望这可以帮助别人。

I ran into the same problem on my MacBook Pro using OS X 10.7.

I was able to compile it using "sudo python2.5 setup.py install"

Not it work's like charm. Hope this might help someone else.

梦一生花开无言 2024-11-06 02:13:16

我没有回答你的问题,但作为替代方案,你是否尝试从源安装,详细信息 此处此处?

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

I don't have an answer to your question, but as an alternative, did you try installing from the source, as detailed here and here?

Furthermore, you can force 32bit python as well by invoking the command python2.6-32 in the terminal, which may be a bit more convenient for testing purposes.

相思故 2024-11-06 02:13:16

有一个简单的方法时,为什么要自己编译东西呢?

  1. 安装 ActivePython 2.6 for Mac
  2. 打开终端并输入 pypm install psyco

Why compile things on your own when there is an easy way out?

  1. Install ActivePython 2.6 for Mac
  2. Open Terminal and type pypm install psyco
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文