首页 > 解决方案 > 无法通过 pip 安装 couchbase:找不到“libcouchbase/couchbase.h”文件

问题描述

我在安装 couchbase 依赖项时遇到了一些问题。

首先,我使用 brew 安装了 v2:

brew install libcouchbase@2

这给了我 v2.10.7。然后我尝试安装我需要的版本:

pip install couchbase==2.5.5

但我一直有这个问题:

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

有任何想法吗?

标签: python-3.xcouchbase

解决方案


我找到了解决方案!我必须运行以下命令:

brew link --force --overwrite libcouchbase@2

然后我得到:

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

在此之后我跑了:

pip install couchbase==2.5.5

而且效果很好!:)


推荐阅读