3

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.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.

2
  • Maybe you need to install the cc program
    – rubik
    Commented Feb 26, 2011 at 9:14
  • Can you maybe reformat error message so people can read it? Otherwise it's easy to say "install c compiler".
    – fijal
    Commented Feb 26, 2011 at 10:09

3 Answers 3

4

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.

2
  • 3
    psh, Twisted considers them optional. But good luck convincing distutils of anything. Commented Feb 26, 2011 at 13:24
  • ah well. zope.interface manages :) Not sure if manages in a good way though.
    – fijal
    Commented Feb 26, 2011 at 18:24
3

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.

1
  • This worked beautifully for me with Twisted 11.0 after my first attempt threw an error. Thanks!
    – John Lyon
    Commented Sep 1, 2011 at 0:52
2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.