How to install twisted 10.2.0 with pypy 1.4.1?

I cannot install twisted 10.2.0 on my ubuntu. After loading the curved source, I issue the command: pypy setup.py install. After that, I get the error message:

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

So how can I fix this? Thank.

+3
source share
3 answers

This is a “bug” in a twisted assembly. This may or may not be a mistake - twisted does not consider it extensions C additional, although they are far from necessary for the most part. Twisted will work if you simply point PYTHONPATH where it is, but without these C. extensions.

+4
source

, , setup.py(73):

       conditionalExtensions = getExtensions(),

, .

+2

So far, the Twisted trunk can be compiled with PyPy (I used 1.6.1-dev0). However, to install Twisted, you need to apply the patch to zipfile.py, which I sent to stdlib.

zipfile.py 2.7.1+ file descriptor leaks due to CPython-oriented programming style used in zipfile.py

Therefore, the installation fails in PyPy, which uses a different GC model than CPython.

+2
source

Source: https://habr.com/ru/post/1794892/


All Articles