6

All,

I'm trying to install the Python Couchbase lib in my Linux server, but it's failing with "libcouchbase/couchbase.h: No such file or directory". I also cannot find which package contains the couchbase.h file. How can I fix this?

ubuntu@ip-172-31-17-167:~$ sudo easy_install couchbase
Searching for couchbase
Reading https://pypi.python.org/simple/couchbase/
Best match: couchbase 1.2.4
Downloading https://pypi.python.org/packages/source/c/couchbase/couchbase-1.2.4.tar.gz#md5=4a51bf3ac1fa26bcb9433d53ac4ba34b
Processing couchbase-1.2.4.tar.gz
Writing /tmp/easy_install-ZF8OtY/couchbase-1.2.4/setup.cfg
Running couchbase-1.2.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ZF8OtY/couchbase-1.2.4/egg-dist-tmp-Az4Noq
In file included from src/exceptions.c:17:0:
src/pycbc.h:25:36: fatal error: libcouchbase/couchbase.h: No such file or directory
 #include 
                                    ^
compilation terminated.
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
ubuntu@ip-172-31-17-167:~$ apt-file search couchbase.h
python-celery-doc: /usr/share/doc/python-celery-doc/html/_modules/celery/backends/couchbase.html
python-celery-doc: /usr/share/doc/python-celery-doc/html/internals/reference/celery.backends.couchbase.html
user43995
  • 597
  • 2
  • 8
  • 21

5 Answers5

12

Try this: http://docs.couchbase.com/couchbase-sdk-c-2.3/#downloading-the-couchbase-client-library

So if you have Ubuntu 12.04:

  1. sudo wget -O/etc/apt/sources.list.d/couchbase.list http://packages.couchbase.com/ubuntu/couchbase-ubuntu1204.list
  2. wget -O- http://packages.couchbase.com/ubuntu/couchbase.key | sudo apt-key add -
  3. sudo apt-get update
  4. sudo apt-get install libcouchbase2-libevent libcouchbase-dev
alexm92
  • 386
  • 3
  • 15
  • 1
    This worked for me on my ubuntu14.04 instance. All I had to do was change line #1 to `sudo wget -O/etc/apt/sources.list.d/couchbase.list http://packages.couchbase.com/ubuntu/couchbase-ubuntu1404.list` – Abundnce10 Dec 08 '15 at 23:59
  • i am getting this error he following packages have unmet dependencies: libcouchbase-dev : Depends: libcouchbase2-core (= 2.8.7-1) but it is not going to be installed libcouchbase2-libev : Depends: libcouchbase2-core (= 2.8.7-1) but it is not going to be installed E: Unable to correct problems, you have held broken packages. ERROR: Service 'php' failed to build: The command '/bin/sh -c apt-get install -y libcouchbase-dev libcouchbase2-libev' returned a non-zero code: 100 – Muhammad Ibrahim Jun 14 '21 at 10:29
4

Updated solution for Ubuntu 18.04

  1. echo "deb http://packages.couchbase.com/ubuntu bionic bionic/main" | sudo tee /etc/apt/sources.list.d/couchbase.list
  2. wget -O- http://packages.couchbase.com/ubuntu/couchbase.key | sudo apt-key add -
  3. sudo apt-get update
  4. sudo apt-get install libcouchbase2-libevent libcouchbase-dev
consoko
  • 41
  • 3
1

They actually wrote a perl script to make the installation easier and safer, so you can:

  1. wget http://packages.couchbase.com/clients/c/couchbase-csdk-setup
  2. sudo perl couchbase-csdk-setup

As explained here.

Ron Klein
  • 9,178
  • 9
  • 55
  • 88
Noa Kuperberg
  • 398
  • 2
  • 6
  • The script runs great, but keep running into unable to locate package errors. Are couchbase libs not yet available for Xenial? – R J Jan 15 '18 at 00:21
0

My Dockerfile (Debian 10)

# couchbase 2.x requires C libs
USER root
RUN wget -O - http://packages.couchbase.com/ubuntu/couchbase.key | apt-key add -
# Adding Ubuntu 18.04 repo to apt/sources.list of 18.10 or 19.04
RUN echo "deb http://packages.couchbase.com/ubuntu bionic bionic/main" | tee /etc/apt/sources.list.d/couchbase.list
RUN apt-get update
RUN apt-get install -y libcouchbase-dev libcouchbase2-bin build-essential
USER ${USER}

# -- Install dependencies: --deploy aborts if the python version
# or Pipfile.lock dependencies are incorrect 
COPY Pipfile Pipfile.lock ./
RUN pipenv install --ignore-pipfile --deploy --system
Lukasz Madon
  • 14,664
  • 14
  • 64
  • 108
0

I was trying to build my repo having this dependencies. Hope this works for you as well.

FROM ruby:2.3.0
WORKDIR /myapp
COPY . /myapp/
RUN apt-get update -y
#RUN apt-get upgrade -y
RUN apt-get install -y lsb-release

RUN wget http://packages.couchbase.com/releases/couchbase-release/couchbase-release-1.0-6-amd64.deb
RUN dpkg -i couchbase-release-1.0-6-amd64.deb
RUN apt-get update -y
RUN apt-get install libcouchbase-dev libcouchbase2-bin build-essential -y
Prince Kumar
  • 331
  • 2
  • 4