celery / librabbitmq

Python bindings to librabbitmq-c
GNU General Public License v2.0
203 stars 91 forks source link

Failed to install librabbitmq on MacOS High Sierra #123

Open shanling2004 opened 6 years ago

shanling2004 commented 6 years ago

Env:

$ 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
gruszczy commented 6 years ago

Same here.

auvipy commented 6 years ago

use py-amqp instead

ivermac commented 6 years ago

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
creslinux commented 6 years ago

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

sgargan commented 6 years ago

same deal here, building on OSX High Sierra 10.13.6

dougbyrne commented 6 years ago

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.

huanghe314 commented 6 years ago

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

guofeng1997 commented 5 years ago

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

quantoid commented 5 years ago

Getting the same failure with:

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

ConnorBarnhill commented 5 years ago

use sudo pip install

bjackson commented 5 years ago

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?

dougbyrne commented 5 years ago

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

wjzhao commented 5 years ago

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

StijnCazou commented 5 years ago

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

bjackson commented 5 years ago

@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/

wjzhao commented 5 years ago

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

quantoid commented 5 years ago

I switched to Redis in the end. :(

StijnLemon commented 5 years ago

@bjackson Doesn't work for me...

lmcl90 commented 5 years ago

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

Kronuz commented 5 years ago

You also need libtool to build under macOS:

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

pip install librabbitmq
bedrockjohan commented 5 years ago

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

sebastienvercammen commented 4 years ago

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
huntzhan commented 4 years ago

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.

ulgens commented 3 years ago

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

auvipy commented 3 years ago

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

ulgens commented 3 years ago

@auvipy Not recommended by who?

auvipy commented 3 years ago

@auvipy Not recommended by who?

by @celery/core-developers

ulgens commented 3 years ago

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

sigaev-pro commented 3 years ago

Same issue on Big Sur.

brew install autoconf automake pkg-config libtool

does not solve the problem.

jspaans91 commented 3 years ago

Same here on Big Sur

tombroi commented 3 years ago

Any help on this issue? brew install autoconf automake pkg-config libtool these installations dont work.

tombroi commented 3 years ago

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

could you solve this issue @ulgens

vschoener commented 3 years ago

Any help on this issue? brew install autoconf automake pkg-config libtool these installations dont work.

This does not work for me :(

hvarday-cisco commented 3 years ago

Hi Folks!

I am facing the same issue. My GCC version is -

hvarday$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

I have verified and the "--with-gxx-include-dir" path does not exist Any help would be appreciated at this point

NixBiks commented 2 years ago

was this never resolved?

rhoitjadhav commented 1 year ago

My issue was resolved by this

Python: 3.10 Macos: 13.4 librabbitmq: 2.0.0

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