1

I am installing pylibrabbitmq on Ubuntu. But getting the error. I have downloaded pylibrabbitmq from Git Hub. And i'm doing 'python setup.py install'. But getting the following error.

Here is the log,

running install
Checking .pth file support in /usr/local/lib/python2.7/dist-packages/
/usr/bin/python -E -c pass
TEST PASSED: /usr/local/lib/python2.7/dist-packages/ appears to support .pth files
running bdist_egg
running egg_info
writing pylibrabbitmq.egg-info/PKG-INFO
writing top-level names to pylibrabbitmq.egg-info/top_level.txt
writing dependency_links to pylibrabbitmq.egg-info/dependency_links.txt
file pylibrabbitmq.py (for module pylibrabbitmq) not found
reading manifest file 'pylibrabbitmq.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*' under directory 'tests'
no previously-included directories found matching '*.pyc'
no previously-included directories found matching '*.o'
no previously-included directories found matching '*.so'
no previously-included directories found matching '*.dylib'
writing manifest file 'pylibrabbitmq.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
file pylibrabbitmq.py (for module pylibrabbitmq) not found
file pylibrabbitmq.py (for module pylibrabbitmq) not found
running build_ext
building '_pyrabbitmq' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c pylibrabbitmq/_rabbitmqmodule.c -o build/temp.linux-x86_64-2.7/pylibrabbitmq/_rabbitmqmodule.o
In file included from /usr/include/python2.7/Python.h:8:0,
                 from pylibrabbitmq/_rabbitmqmodule.h:16,
                 from pylibrabbitmq/_rabbitmqmodule.c:7:
/usr/include/python2.7/pyconfig.h:1161:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]
/usr/include/features.h:215:0: note: this is the location of the previous definition
In file included from pylibrabbitmq/_rabbitmqmodule.c:7:0:
pylibrabbitmq/_rabbitmqmodule.h:18:18: fatal error: amqp.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
MJQ
  • 1,778
  • 6
  • 34
  • 60

1 Answers1

1

You're missing amqp.h (the C header file from librabbitmq, the libarary pylibrabbitmq relies upon).

Either install that file manually, or install the package that contains it, librabbitmq-dev.

phihag
  • 278,196
  • 72
  • 453
  • 469
  • It is in /tmp/src/rabbit/rabbitmq-c/librabbitmq. – MJQ Jul 19 '12 at 13:44
  • That directory is not in the default [header search path](http://gcc.gnu.org/onlinedocs/cpp/Search-Path.html). Move it one of the default locations or add `-I/tmp/src/rabbit/rabbitmq-c/librabbitmq` to the gcc invocation to add it to the search path. – phihag Jul 19 '12 at 13:48
  • Can you plz tell how can I add -I/tmp/src/rabbit/rabbitmq-c/librabbitmq to the gcc invocation??? – MJQ Jul 19 '12 at 14:14
  • It will be way easier just to install it in a default location. But if you insist, set `extra_compile_args` in `setup.py`, like in [this question](http://stackoverflow.com/questions/1676384/how-to-pass-flag-to-gcc-in-python-setup-py-script). Looking at the [source code](https://github.com/pombredanne/pylibrabbitmq/blob/master/setup.py#L27), passing the `--with-rabbitmq` flag to setup.py ought to work as well. – phihag Jul 19 '12 at 14:32