这仅在 pypy 构建下的 Travis 中发生。这是确切的错误字符串:
Traceback (most recent call last):
File "app_main.py", line 75, in run_toplevel
File "app_main.py", line 581, in run_it
File "<string>", line 1, in <module>
File "tests/test_pycouchbase.py", line 15, in <module>
from pycouchbase.utils import *
File "pycouchbase/__init__.py", line 8, in <module>
from .connection import Connection
File "pycouchbase/connection.py", line 3, in <module>
from couchbase.bucket import Bucket
File "/home/travis/virtualenv/pypy-2.5.0/site-packages/couchbase/__init__.py", line 28, in <module>
from couchbase.user_constants import *
File "/home/travis/virtualenv/pypy-2.5.0/site-packages/couchbase/user_constants.py", line 21, in <module>
import couchbase._bootstrap
File "/home/travis/virtualenv/pypy-2.5.0/site-packages/couchbase/_bootstrap.py", line 34, in <module>
import couchbase.exceptions as E
File "/home/travis/virtualenv/pypy-2.5.0/site-packages/couchbase/exceptions.py", line 18, in <module>
import couchbase._libcouchbase as C
ImportError: No module named couchbase._libcouchbase
我已经在尝试安装 couchbase_cffi,但看起来_libcouchbase.so
文件仍然丢失。
构建链接:https ://travis-ci.org/ardydedase/pycouchbase/jobs/75973023#L1782
特拉维斯配置文件:
# Config file for automatic testing at travis-ci.org
language: python
python:
- "3.4"
- "3.3"
- "2.7"
- "2.6"
- "pypy"
before_install:
- sudo rm -rf /etc/apt/sources.list.d/*
- sudo add-apt-repository -y ppa:pypy/ppa
- wget -O- http://packages.couchbase.com/ubuntu/couchbase.key | sudo apt-key add -
- echo deb http://packages.couchbase.com/ubuntu precise precise/main | sudo tee /etc/apt/sources.list.d/couchbase.list
- sudo apt-get update
- sudo apt-cache search libcouchbase
install:
# GCC
- sudo apt-get install python-software-properties
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update
- sudo apt-get -y install gcc-4.8
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
# libcouchbase dependencies
- sudo apt-get -y install libxml2-dev libxslt-dev python-all-dev libffi6 libffi-dev
- sudo apt-get -y install build-essential libssl-dev python-openssl
- sudo apt-get -y install libcouchbase-dev libcouchbase2-core libcouchbase2-libevent libevent-dev python-gevent
- pip -q install gevent || echo "Couldn't find gevent"
- pip -q install twisted
- pip -q install testresources
- pip install -r requirements.txt
# command to run tests, e.g. python setup.py test
script:
# - cd couchbase-python-cffi
# - export CFLAGS=-Qunused-arguments
# - export CPPFLAGS=-Qunused-arguments
# - python setup.py test
# - python setup.py build
- echo $PWD
# - if [[ $TRAVIS_PYTHON_VERSION == pypy ]]; then git clone https://github.com/couchbase/couchbase-python-client.git && cd couchbase-python-client && python setup.py build_ext --inplace && cd ..; fi
- if [[ $TRAVIS_PYTHON_VERSION == pypy ]]; then cd couchbase-python-cffi && python setup.py build && python setup.py install && cd .. && ls -al; fi
- if [[ $TRAVIS_PYTHON_VERSION == pypy ]]; then ls -al /home/travis/virtualenv/pypy-2.5.0/site-packages/couchbase; fi
- python -c "from tests import test_pycouchbase; print(test_pycouchbase)"
- python runtests.py
我确实尝试参考这个线程:https ://forums.couchbase.com/t/installing-couchbase-1-0-0-on-ubuntu/291 ,但我找不到build
被引用的文件夹那里。