1. 程式人生 > >部署測試環境時遇到的問題及解決辦法

部署測試環境時遇到的問題及解決辦法

1、安裝couchbase提示:error: command ‘gcc’ failed with exit status 1是因為缺少依賴包,手動安裝以下依賴

wget http://packages.couchbase.com/releases/couchbase-release/couchbase-release-1.0-2-x86_64.rpm

rpm --instsall couchbase-release-1.0-2-x86_64.rpm

yum install libcouchbase-devel
yum install mysql-devel
yum install gcc
yum install gcc-c++
yum install python-devel
setuptools(yum裡沒找到就沒安裝,不過問題也解決了)
pip install virtualenv
pyformance(沒有安裝)
yum install PyYAML

2、EnvironmentError: mysql_config not found

解決方案:yum install mysql-devel

3、未安裝pip

http://www.ttlsa.com/python/how-to-install-and-use-pip-ttlsa/

4、直接使用pip安裝couchbase時報錯(pip install couchbase)

fatal error: libcouchbase/views.h: No such file or directory
     #include <libcouchbase/views.h>
                                    ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1

解決方法:

下載原始碼包安裝:

wget https://pypi.python.org/packages/source/c/couchbase/couchbase-0.11.tar.gz

tar xzvf couchbase-0.11.tar.gz

cd couchbase-0.11.tar
python setup.py build_ext --inplace 
python setup.py install
如果報 libcouchbase/couchbase.h 找不到的錯誤,請在built的時候加上c庫的lib和include路徑
    python setup.py build_ext --inplace \
    --library-dir /opt/localbcouchbaseb \
    --include-dir /opt/localbcouchbase/include