Unable to install couchbase via pip: 'libcouchbase/couchbase.h' file not found

Viewed 1371

I am having some trouble installing couchbase dependencies.

First I installed v2 using brew:

brew install libcouchbase@2

This gave me v2.10.7. Then I tried to install the version I need:

pip install couchbase==2.5.5

But I keep having this issue:

ERROR: Command errored out with exit status 1:
...
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/include -I/Users/.../.pyenv/versions/3.6.8/include/python3.6m -c src/exceptions.c -o build/temp.macosx-10.13-x86_64-3.6/src/exceptions.o
In file included from src/exceptions.c:17:
src/pycbc.h:193:10: fatal error: 'libcouchbase/couchbase.h' file not found
#include <libcouchbase/couchbase.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1

Any ideas?

3 Answers

I found the solution! I had to run the following command:

brew link --force --overwrite libcouchbase@2

And then I got:

Linking /usr/local/Cellar/libcouchbase@2/2.10.7... 77 symlinks created

After this I ran:

pip install couchbase==2.5.5

And it worked fine! :)

I think it gave you this error because libcouchbase was not installed. Try to re-install it without "@2" at the end.

brew install libcouchbase

After that re-install with pip.

pip install couchbase==2.5.5
Related