开发者

How to install twisted 10.2.0 with pypy 1.4.1?

I can't install twisted 10.2.0 to my ubuntu box. After download twisted source I issue the command: pypy setup.py install. After that I receive the error:

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.开发者_Go百科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

So, how can I fix it? Thanks.


That's a "bug" in twisted build. It might be or might not be a bug - twisted does not consider it's C extensions optional, although they're far from necessary for the most part. Twisted would still work if you just point PYTHONPATH to where it is situated, but without those C extensions.


You may be able to skip building extensions by commenting off the following line in setup.py (73):

       conditionalExtensions = getExtensions(),

This should avoid collecting and trying to build extensions scattered in the directory tree.


As for now Twisted trunk could be compiled OK with PyPy (I used 1.6.1-dev0). However in order to install Twisted you'd need to apply a patch to zipfile.py that I have submitted to stdlib.

zipfile.py 2.7.1+ leaks file descriptors because of CPython-oriented programming style used in zipfile.py

Therefore installation fails under PyPy that uses other GC model than CPython does.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜