Description
The following seems like it should work:
from couchbase_core.cluster import PasswordAuthenticator |
from couchbase.cluster import ClusterOptions |
from txcouchbase.cluster import TxCluster |
from twisted.internet import reactor |
|
|
def cb(resp): |
for r in resp.rows(): |
print(r) |
|
|
cluster = TxCluster.connect('couchbase://10.143.194.101', |
ClusterOptions(PasswordAuthenticator('Administrator', 'password'))) |
b = cluster.bucket('beer-sample') |
resp = b.view_query("beer", "brewery_beers", limit=10) |
resp.add_callback(cb)
|
|
# shutdown reactor after 10 seconds
|
reactor.callLater(10, reactor.stop) |
reactor.run()
|
However, I now get:
Traceback (most recent call last):
|
File "txminimal.py", line 1, in <module>
|
from couchbase_core.cluster import PasswordAuthenticator
|
File "/Users/davidkelly/projects/gerrit/couchbase-python-client/couchbase_core/cluster.py", line 20, in <module>
|
from .client import Client
|
File "/Users/davidkelly/projects/gerrit/couchbase-python-client/couchbase_core/client.py", line 5, in <module>
|
import couchbase.exceptions as E
|
File "/Users/davidkelly/projects/gerrit/couchbase-python-client/couchbase/__init__.py", line 3, in <module>
|
from .bucket import *
|
File "/Users/davidkelly/projects/gerrit/couchbase-python-client/couchbase/bucket.py", line 1, in <module>
|
from couchbase.management import CollectionManager, ViewIndexManager
|
File "/Users/davidkelly/projects/gerrit/couchbase-python-client/couchbase/management/__init__.py", line 2, in <module>
|
from .views import ViewIndexManager
|
File "/Users/davidkelly/projects/gerrit/couchbase-python-client/couchbase/management/views.py", line 22, in <module>
|
from couchbase_core.client import Client
|
ImportError: cannot import name 'Client' from 'couchbase_core.client' (/Users/davidkelly/projects/gerrit/couchbase-python-client/couchbase_core/client.py)
|
This used to work. I'm guessing that maybe a recent refactor broke this.