【问题标题】:Trying to install Couchbase, with gcc command fails, Python尝试安装 Couchbase,使用 gcc 命令失败,Python
【发布时间】:2014-03-18 03:45:46
【问题描述】:

我尝试为 python 安装 couchbase,但出现以下错误:

building 'couchbase._libcouchbase' extension
creating build/temp.linux-i686-2.7
creating build/temp.linux-i686-2.7/src
creating build/temp.linux-i686-2.7/src/viewrow
creating build/temp.linux-i686-2.7/src/contrib
creating build/temp.linux-i686-2.7/src/contrib/jsonsl
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -    fPIC -I/usr/include/python2.7 -c src/exceptions.c -o build/temp.linux-i686-2.7/src/exceptions.o
In file included from src/exceptions.c:17:0:
src/pycbc.h:25:36: fatal error: libcouchbase/couchbase.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1

我安装了 couchbase 服务器和 c 库,我已经有了:

sudo apt-get install build-essential # for a C compiler
sudo apt-get install python-dev

那怎么了?

【问题讨论】:

    标签: python gcc couchbase


    【解决方案1】:

    你应该先安装 libcouchbase http://www.couchbase.com/communities/c/getting-started

    wget -O- http://packages.couchbase.com/ubuntu/couchbase.key | sudo apt-key add - 
    sudo wget -O/etc/apt/sources.list.d/couchbase.list \
        http://packages.couchbase.com/ubuntu/couchbase-ubuntu1204.list
    sudo apt-get update
    sudo apt-get install libcouchbase2-libevent libcouchbase-dev
    

    【讨论】:

      【解决方案2】:

      debian wheezy 怎么样? libcouchbase2-libevent:取决于:libevent-1.4-2 (>= 1.4.13-stable) 但不可安装 libcouchbase2-core :取决于:libssl0.9.8 (>= 0.9.8k-1) 但它不可安装

      【讨论】:

        【解决方案3】:

        如果 libcouchbase 不在 repo 中,请克隆 libcouchbase repo 并按照那里的说明进行安装:

        $ git clone git://github.com/couchbase/libcouchbase.git
        $ cd libcouchbase && mkdir build && cd build
        $ ../cmake/configure
        $ make
        $ sudo make install
        

        最后从 pip 安装 python 库:

        sudo -H pip3 install couchbase
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2015-01-26
          • 2015-05-13
          • 2013-09-27
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2016-11-01
          • 2023-03-08
          相关资源
          最近更新 更多