如何用pypy1.4.1安装twisted 10.2.0?

2024-06-09 02:44:06 发布

您现在位置:Python中文网/ 问答频道 /正文

我无法将twisted 10.2.0安装到我的ubuntu设备上。下载twisted source之后,我发出命令:pypy设置.py安装。之后,我收到错误:

building 'twisted.runner.portmap' extension
creating build/temp.linux-x86_64-2.5
creating build/temp.linux-x86_64-2.5/twisted
creating build/temp.linux-x86_64-2.5/twisted/runner
cc -I/builds/pypy-1.4.1-linux64/include -c twisted/runner/portmap.c -o build/temp.linux-x86_64-2.5/twisted/runner/portmap.o
cc -shared build/temp.linux-x86_64-2.5/twisted/runner/portmap.o -o build/lib.linux-x86_64-2.5/twisted/runner/portmap.pypy-14.so
/usr/bin/ld.bfd.real: build/temp.linux-x86_64-2.5/twisted/runner/portmap.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
build/temp.linux-x86_64-2.5/twisted/runner/portmap.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
error: command 'cc' failed with exit status 1

那么,我该怎么解决呢?谢谢。在


Tags: buildcreatinglinuxwithexittwistednotpypy
3条回答

您可以通过注释the following line in setup.py (73)跳过生成扩展:

       conditionalExtensions = getExtensions(),

这应该避免收集和尝试构建分散在目录树中的扩展。在

至于现在Twisted trunk可以用PyPy编译了(我使用了1.6.1-dev0)。 但是为了安装Twisted,您需要将patch应用到zipfile.py文件我已经提交给stdlib。在

在zipfile.py文件2.7.1+由于在zipfile.py文件在

因此,在使用CPython之外的其他GC模型的PyPy下安装失败。在

那是扭曲身材的“臭虫”。它可能是也可能不是bug-twisted并不认为它是可选的C扩展,尽管它们在大多数情况下还远远没有必要。Twisted仍然可以工作,如果你只是把PYTHONPATH指向它所在的位置,但是没有那些C扩展。在

相关问题 更多 >