librabbitmq icon indicating copy to clipboard operation
librabbitmq copied to clipboard

Failed to install librabbitmq on MacOS High Sierra

Open shanling2004 opened this issue 6 years ago • 37 comments

Env:

  • MacOS High Sierra 10.13.3
  • Python 3.6.5 I encounter the below issue, any idea?

$ pip install librabbitmq==2.0.0

    /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/Modules/_librabbitmq/connection.c:299:29: warning: comparison of integers of different signs: 'uint64_t' (aka 'unsigned long long') and 'int' [-Wsign-compare]
                if (clong_value == -1)
                    ~~~~~~~~~~~ ^  ~~
    /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/Modules/_librabbitmq/connection.c:365:17: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
        while (item = PyIter_Next(iterator)) {
               ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
    /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/Modules/_librabbitmq/connection.c:365:17: note: place parentheses around the assignment to silence this warning
        while (item = PyIter_Next(iterator)) {
                    ^
               (                           )
    /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/Modules/_librabbitmq/connection.c:365:17: note: use '==' to turn this assignment into an equality comparison
        while (item = PyIter_Next(iterator)) {
                    ^
                    ==
    /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/Modules/_librabbitmq/connection.c:410:1: warning: unused label 'error' [-Wunused-label]
    error:
    ^~~~~~
    /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/Modules/_librabbitmq/connection.c:1003:16: warning: incompatible pointer to integer conversion returning 'PyObject *' (aka 'struct _object *') from a function with result type 'int' [-Wint-conversion]
            return PyErr_NoMemory();
                   ^~~~~~~~~~~~~~~~
    /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/Modules/_librabbitmq/connection.c:1359:13: warning: implicit declaration of function 'amqp_simple_wait_frame_on_channel' is invalid in C99 [-Wimplicit-function-declaration]
                amqp_simple_wait_frame_on_channel(conn, cur_channel, &frame);
                ^
    /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/Modules/_librabbitmq/connection.c:1359:13: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    6 warnings generated.
    clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/rabbitmq-c/librabbitmq -I/private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/rabbitmq-c -I/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/rabbitmq-c/librabbitmq/amqp_api.c -o build/temp.macosx-10.13-x86_64-3.6/private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/rabbitmq-c/librabbitmq/amqp_api.o
    In file included from /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/rabbitmq-c/librabbitmq/amqp_api.c:48:
    /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/rabbitmq-c/librabbitmq/amqp_private.h:332:1: error: expected ')'
    DECLARE_XTOXLL(hton)
    ^
    /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/rabbitmq-c/librabbitmq/amqp_private.h:298:26: note: expanded from macro 'DECLARE_XTOXLL'
      static inline uint64_t func##ll(uint64_t val)     \
                             ^
    <scratch space>:425:1: note: expanded from here
    htonll
    ^
    /usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'
    #define htonll(x)       __DARWIN_OSSwapInt64(x)
                            ^
    /usr/include/libkern/_OSByteOrder.h:78:30: note: expanded from macro '__DARWIN_OSSwapInt64'
        (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
                                 ^
    /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/rabbitmq-c/librabbitmq/amqp_private.h:332:1: note: to match this '('
    /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/rabbitmq-c/librabbitmq/amqp_private.h:298:26: note: expanded from macro 'DECLARE_XTOXLL'
      static inline uint64_t func##ll(uint64_t val)     \
                             ^
    <scratch space>:425:1: note: expanded from here
    htonll
    ^
    /usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'
    #define htonll(x)       __DARWIN_OSSwapInt64(x)
                            ^
    /usr/include/libkern/_OSByteOrder.h:78:5: note: expanded from macro '__DARWIN_OSSwapInt64'
        (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
        ^
    In file included from /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/rabbitmq-c/librabbitmq/amqp_api.c:48:
    /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/rabbitmq-c/librabbitmq/amqp_private.h:332:1: error: definition of builtin function '__builtin_constant_p'
    DECLARE_XTOXLL(hton)
    ^
    /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/rabbitmq-c/librabbitmq/amqp_private.h:298:26: note: expanded from macro 'DECLARE_XTOXLL'
      static inline uint64_t func##ll(uint64_t val)     \
                             ^
    <scratch space>:425:1: note: expanded from here
    htonll
    ^
    /usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'
    #define htonll(x)       __DARWIN_OSSwapInt64(x)
                            ^
    /usr/include/libkern/_OSByteOrder.h:78:6: note: expanded from macro '__DARWIN_OSSwapInt64'
        (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
         ^
    In file included from /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/rabbitmq-c/librabbitmq/amqp_api.c:48:
    /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/rabbitmq-c/librabbitmq/amqp_private.h:333:1: error: expected ')'
    DECLARE_XTOXLL(ntoh)
    ^
    /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/rabbitmq-c/librabbitmq/amqp_private.h:298:26: note: expanded from macro 'DECLARE_XTOXLL'
      static inline uint64_t func##ll(uint64_t val)     \
                             ^
    <scratch space>:428:1: note: expanded from here
    ntohll
    ^
    /usr/include/sys/_endian.h:140:25: note: expanded from macro 'ntohll'
    #define ntohll(x)       __DARWIN_OSSwapInt64(x)
                            ^
    /usr/include/libkern/_OSByteOrder.h:78:30: note: expanded from macro '__DARWIN_OSSwapInt64'
        (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
                                 ^
    /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/rabbitmq-c/librabbitmq/amqp_private.h:333:1: note: to match this '('
    /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/rabbitmq-c/librabbitmq/amqp_private.h:298:26: note: expanded from macro 'DECLARE_XTOXLL'
      static inline uint64_t func##ll(uint64_t val)     \
                             ^
    <scratch space>:428:1: note: expanded from here
    ntohll
    ^
    /usr/include/sys/_endian.h:140:25: note: expanded from macro 'ntohll'
    #define ntohll(x)       __DARWIN_OSSwapInt64(x)
                            ^
    /usr/include/libkern/_OSByteOrder.h:78:5: note: expanded from macro '__DARWIN_OSSwapInt64'
        (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
        ^
    In file included from /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/rabbitmq-c/librabbitmq/amqp_api.c:48:
    /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/rabbitmq-c/librabbitmq/amqp_private.h:333:1: error: definition of builtin function '__builtin_constant_p'
    DECLARE_XTOXLL(ntoh)
    ^
    /private/var/folders/y9/z4pjlg2d3xj7z7q53fthpwsr0000gn/T/pip-install-uot9ru9d/librabbitmq/rabbitmq-c/librabbitmq/amqp_private.h:298:26: note: expanded from macro 'DECLARE_XTOXLL'
      static inline uint64_t func##ll(uint64_t val)     \
                             ^
    <scratch space>:428:1: note: expanded from here
    ntohll
    ^
    /usr/include/sys/_endian.h:140:25: note: expanded from macro 'ntohll'
    #define ntohll(x)       __DARWIN_OSSwapInt64(x)
                            ^
    /usr/include/libkern/_OSByteOrder.h:78:6: note: expanded from macro '__DARWIN_OSSwapInt64'
        (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
         ^
    4 errors generated.
    error: command 'clang' failed with exit status 1

shanling2004 avatar Jul 13 '18 02:07 shanling2004

Same here.

gruszczy avatar Jul 23 '18 01:07 gruszczy

use py-amqp instead

auvipy avatar Aug 13 '18 16:08 auvipy

Getting the same problem when trying to install librabbitmq version 2.0.0. Any help would highly be appreciated.

Env:

MacOS High Sierra 10.13.6
Python 3.6.4

ivermac avatar Aug 14 '18 12:08 ivermac

I've hit a brick wall here too:

I'm running into this, spent the morning trying various means to install librabbitmq to no luck

Is there an how-to install on OSX? Im on python 3.6, virtual-env

I've installed:

brew install autoconf brew install automake brew install pkg-config Ive tried:

git clone https://github.com/celery/librabbitmq.git cd librabbitmq git submodule init git submodule update

pip, pip3, easy_install.. same deal every time error: command 'clang' failed with exit status 1

creslinux avatar Aug 18 '18 09:08 creslinux

same deal here, building on OSX High Sierra 10.13.6

sgargan avatar Oct 26 '18 15:10 sgargan

Hi, seeing the same. Also on 10.13.6.

It seems to be a problem in the rabbitmq-c configure, or in the case of #121 autoconf isn't available at all. In either case, HAVE_HTONLL doesn't get defined, and that messes stuff up.

I'm going to open a issue on the rabbitmq-c side.

dougbyrne avatar Oct 30 '18 13:10 dougbyrne

I've hit a brick wall here too:

I'm running into this, spent the morning trying various means to install librabbitmq to no luck

Is there an how-to install on OSX? Im on python 3.6, virtual-env

I've installed:

brew install autoconf brew install automake brew install pkg-config Ive tried:

git clone https://github.com/celery/librabbitmq.git cd librabbitmq git submodule init git submodule update

pip, pip3, easy_install.. same deal every time error: command 'clang' failed with exit status 1

I tried your solution and after brew install automake, librabbitmq is installed successfully, same python version and librabbitmq version as yours, but my Mac version is 10.14

huanghe314 avatar Nov 29 '18 12:11 huanghe314

git clone https://github.com/celery/librabbitmq.git cd librabbitmq python setup.py install

guofeng1997 avatar Jan 09 '19 08:01 guofeng1997

Getting the same failure with:

  • python 3.7.2
  • MacOS 10.14.2 (Mojave)

Installing autoconf and automake made no difference.

Installing by cloning the git repo as described in the previous comment gives the same error (not surprisingly).

quantoid avatar Jan 15 '19 03:01 quantoid

use sudo pip install

ConnorBarnhill avatar Jan 31 '19 15:01 ConnorBarnhill

I was able to get it to build by using Xcode Command Line Tools 10.2. Can anyone else confirm that it works for them?

bjackson avatar Feb 19 '19 02:02 bjackson

@bjackson That one did it for me. I installed the beta tools and the library built OK.

dougbyrne avatar Feb 19 '19 14:02 dougbyrne

I have the same problem, so, how do you resolve it ? My environment is : python3.6.3 pip18.1 macOS 10.13.2

wjzhao avatar Feb 20 '19 15:02 wjzhao

@bjackson How do you mean? You used de Command tools?

StijnCazou avatar Feb 25 '19 18:02 StijnCazou

@StijnCazou and @wjzhao, you will need to upgrade your Xcode Command Line Tools to 10.2. The upgraded command line tools might include a fix that allows librabbitmq-c to build.

You can download Xcode Command Line Tools 10.2 here: https://developer.apple.com/download/more/

bjackson avatar Feb 25 '19 18:02 bjackson

@bjackson Thank you, I have resolve the problem by your way~~

wjzhao avatar Mar 08 '19 07:03 wjzhao

I switched to Redis in the end. :(

quantoid avatar Mar 08 '19 08:03 quantoid

@bjackson Doesn't work for me...

StijnLemon avatar Mar 08 '19 08:03 StijnLemon

My env is:

macOS Mojave 10.14.3
python 3.7.0

I solved this problem by:

brew install autoconf
brew install automake
brew install pkg-config

@creslinux @huanghe314

lmcl90 avatar Apr 01 '19 14:04 lmcl90

You also need libtool to build under macOS:

brew install autoconf
brew install automake
brew install pkg-config
brew install libtool

pip install librabbitmq

Kronuz avatar Jul 11 '19 22:07 Kronuz

brew install libtool like @Kronuz said is what fixed it for me!

bedrockjohan avatar Aug 05 '19 15:08 bedrockjohan

It's 2020, and I had a similar issue as described above. Only the full commands that @Kronuz shared fixed it.

brew install autoconf automake pkg-config libtool
pip install librabbitmq

sebastienvercammen avatar Jul 20 '20 08:07 sebastienvercammen

It's 2020/08/31, and for some unknown reason Apple pushed the #Xcode12 Beta 5 (build 12A8189h, requires macOS 10.15.4+) to my MacBook and afterward Clang 12.0.0 (1200.0.31.1) was installed then causing compiling error in pip install librabbitmq.

Need to rollback to Command Line Tools for Xcode 11.5 (download here) to resolve this issue.

huntzhan avatar Aug 31 '20 09:08 huntzhan

2020/12/20

Under Big Sur, recommended brew packages doesn't solve the issue and Mac OS doesn't allow to downgrade xcode version by saying "Your Mac OS version is too new for this version.".

ulgens avatar Dec 20 '20 12:12 ulgens

please use py-amqp as this library is not recommended anymore. py-amqp also has some cython bindings

auvipy avatar Dec 21 '20 06:12 auvipy

@auvipy Not recommended by who?

ulgens avatar Dec 22 '20 05:12 ulgens

@auvipy Not recommended by who?

by @celery/core-developers

auvipy avatar Dec 22 '20 06:12 auvipy

@auvipy Thanks a lot. Is this mentioned in celery docs, how can i get detailed info on this?

ulgens avatar Dec 22 '20 06:12 ulgens

No it is not. But we don't maintain it ourselves. We only accept patches for it.

thedrow avatar Dec 24 '20 12:12 thedrow

Same issue on Big Sur.

brew install autoconf automake pkg-config libtool

does not solve the problem.

sigaev-pro avatar Mar 16 '21 08:03 sigaev-pro