couchbaselabs / couchbase-python-cffi

Implementation of the Python Couchbase API using cffi
11 stars 9 forks source link

Cannot install due to AttributeError: LCB_SUBDOC_MULTI_FAILURE #5

Open sublee opened 7 years ago

sublee commented 7 years ago

I tried to install couchbase-2.2.2 and couchbase-python-cffi@2.x in my PyPy environment. But the installation was failed due to an error:

$ pip install couchbase
Collecting couchbase
  Using cached couchbase-2.2.2.tar.gz
Installing collected packages: couchbase
  Running setup.py install for couchbase ... done
Successfully installed couchbase-2.2.2
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

$ cd ~/couchbase-python-cffi
$ python setup.py install
Traceback (most recent call last):
  File "setup.py", line 2, in <module>
    import couchbase_ffi._cinit
  File "/home/sub/works/couchbase-python-cffi/couchbase_ffi/__init__.py", line 51, in <module>
    _libcouchbase._stage2_bootstrap()
  File "/home/sub/works/couchbase-python-cffi/couchbase_ffi/_libcouchbase.py", line 78, in _stage2_bootstrap
    from couchbase_ffi.bucket import Bucket
  File "/home/sub/works/couchbase-python-cffi/couchbase_ffi/bucket.py", line 18, in <module>
    import couchbase_ffi.executors as executors
  File "/home/sub/works/couchbase-python-cffi/couchbase_ffi/executors.py", line 4, in <module>
    from couchbase.exceptions import ValueFormatError, ArgumentError, CouchbaseError
  File "/home/sub/env-pypy/site-packages/couchbase/exceptions.py", line 507, in <module>
    class SubdocMultipleErrors(CouchbaseError):
  File "/home/sub/env-pypy/site-packages/couchbase/exceptions.py", line 509, in SubdocMultipleErrors
    CODE = C.LCB_SUBDOC_MULTI_FAILURE
  File "/home/sub/works/couchbase-python-cffi/couchbase_ffi/__init__.py", line 46, in __getattr__
    raise AttributeError(item)
AttributeError: LCB_SUBDOC_MULTI_FAILURE

My PyPy environment is:

Python 2.7.10 (5.0.1+dfsg-4, Apr 08 2016, 00:22:14)
[PyPy 5.0.1 with GCC 5.3.1 20160407]
avsej commented 7 years ago

What is the libcouchbase version? LCB_SUBDOC_MULTI_FAILURE was introduced in 2.5.6

sublee commented 7 years ago

The version is 2.6.2-132610. Can't I use this version?

avsej commented 7 years ago

Yes, you can. Maybe problem in FFI bindings. @mnunberg could you take a look?

mnunberg commented 7 years ago

I'm trying to fix this, but you should use the exact version of the Python client as mentioned in the README. In this case, 2.0.0-beta.

Newer is not always better, because this module relies on the internals of the Python SDK. You'll get weird errors otherwise

mnunberg commented 7 years ago

btw, what kind of features are you planning to use with this library? the cffi module hasn't been updated very recently - mainly because there's been a few changes internally within the library.

sublee commented 7 years ago

@mnunberg I need the sub-document API, N1QL, and many awesome features of the latest Couchbase.

My project depends on couchbase-2.2.2 for CPython with Couchbase Server 4.6. Now I'm going to move to PyPy but am hindered by this issue.

So, currently, there's no way to use latest Couchbase features in PyPy?

mnunberg commented 7 years ago

It’ll likely take a while (weeks-months) until I’m able to implement all those bits in cffi :(

On Mar 16, 2017, at 7:28 PM, Heungsub Lee notifications@github.com wrote:

@mnunberg https://github.com/mnunberg I need the sub-document API, N1QL, and many awesome features of the latest Couchbase.

My project depends on couchbase-2.2.2 for CPython with Couchbase Server 4.6. Now I'm going to move to PyPy but am hindered by this issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/couchbaselabs/couchbase-python-cffi/issues/5#issuecomment-287249745, or mute the thread https://github.com/notifications/unsubscribe-auth/AAanUT8zdKNK66KxBYL5uXcKVLfED4SKks5rme_SgaJpZM4MdngI.

sublee commented 7 years ago

@mnunberg If you need any of my help, I will do something for you. Anyway, I have appreciated you for developing the Python client library and this binding.

sublee commented 7 years ago

Do you have any plan to support the latest libcouchbase by couchbase-python-cffi?

paulaangb commented 6 years ago

Do we have any support for latest python version? We can't run pypy mode for our project!