Ubuntu - 尝试安装Python Couchbase lib - " libcouchbase / couchbase.h:没有这样的文件或目录"

时间:2014-12-27 18:56:19

标签: python linux couchbase

所有

我试图在我的Linux服务器上安装Python Couchbase lib,但它没有使用" libcouchbase / couchbase.h:没有这样的文件或目录"。我也找不到哪个包包含couchbase.h文件。我该如何解决这个问题?

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

4 个答案:

答案 0 :(得分:11)

试试这个:http://docs.couchbase.com/couchbase-sdk-c-2.3/#downloading-the-couchbase-client-library

所以如果你有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

答案 1 :(得分:1)

他们实际编写了一个perl脚本,使安装更容易,更安全,所以你可以:

  1. wget http://packages.couchbase.com/clients/c/couchbase-csdk-setup
  2. sudo perl couchbase-csdk-setup
  3. 正如here所述。

答案 2 :(得分:0)

Ubuntu 18.04的更新解决方案

  1. 回显“ deb http://packages.couchbase.com/ubuntu仿生仿生/主要” | sudo tee /etc/apt/sources.list.d/couchbase.list
  2. wget -O- http://packages.couchbase.com/ubuntu/couchbase.key | sudo apt键添加-
  3. sudo apt-get更新
  4. sudo apt-get install libcouchbase2-libevent libcouchbase-dev

答案 3 :(得分:0)

我的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