Search code examples
pythonpython-2.7twistedcrossbar

Twisted compilation failed in Ubuntu 14.04


I am trying to install Crossbar in my ubuntu 14.04.
I installed the dependencies as per the instruction here.
When I am trying to install cross the twisted installation fails.
I am having python 2.7.6. I installed all the python-devl packages and all are up to date. I am getting the below error when I execute "pip install crossbar".

copying twisted/internet/iocpreactor/iocpsupport/winsock_pointers.c -> build/lib.linux-i686-2.7/twisted/internet/iocpreactor/iocpsupport
copying twisted/python/sendmsg.c -> build/lib.linux-i686-2.7/twisted/python
copying twisted/test/raiser.c -> build/lib.linux-i686-2.7/twisted/test
running build_ext
cc -O2 -fPIC -Wimplicit -I/usr/lib/pypy/include -c conftest.c -o conftest.o
building 'twisted.runner.portmap' extension
creating build/temp.linux-i686-2.7
creating build/temp.linux-i686-2.7/twisted
creating build/temp.linux-i686-2.7/twisted/runner
cc -O2 -fPIC -Wimplicit -I/usr/lib/pypy/include -c twisted/runner/portmap.c -o build/temp.linux-i686-2.7/twisted/runner/portmap.o
twisted/runner/portmap.c:10:20: fatal error: Python.h: No such file or directory
include <Python.h>
compilation terminated.error: command 'cc' failed with exit status 1

Solution

  • Do you have the dev files installed from pypy? I don't use Ubuntu, but I believe the package is called pypy-dev. I contains a proper Python.h.

    The one you mention belongs to the main Python installation. /usr/include/python2.7/Python.h