I had installed python sdk in build machine and copied all installed files in another couchbase node and tried to use sdk. I am getting below error for _libcouchbase.so
from couchbase.user_constants import *
File “/DG/activeRelease/lib/python_lib/couchbase/user_constants.py”, line 21, in <module> import couchbase._bootstrap File “/DG/activeRelease/lib/python_lib/couchbase/_bootstrap.py”, line 34, in <module> import couchbase.exceptions as E File “/DG/activeRelease/lib/python_lib/couchbase/exceptions.py”, line 18, in <module> import couchbase._libcouchbase as C
ImportError: /DG/activeRelease/lib/python_lib/couchbase/_libcouchbase.so: undefined symbol: lcbtrace_span_get_operation
And I have used import as below:
import sys
sys.path.append('/DG/activeRelease/lib/python_lib/')
from couchbase.bucket import Bucket
from couchbase.views.params import Query
from couchbase.exceptions import CouchbaseError
from couchbase.exceptions import NotFoundError
The same code works for couchbase python sdk 2.3.2
Hi @Arihant, you need libcouchbase 2.9.0 or greater to run recent Couchbase Python clients. Looks like you have an older version on this machine?
I strengthened the checks in the C bindings for the client, so that they inform you of the need to upgrade during compilation, but as you copied the compiled extension across, you will not have seen this error.
I will see if I can add some more explanatory error message when the C extension is pulled in, although it would likely require a multi-phase loading process as the C extension pulls in newer API calls. There’s another JIRA related to this here: Loading...
This indicates the target system has libcouchbase 2.8.7. You need to upgrade to at least libcouchbase 2.9.0. Preferably the latest version (2.10.3 at time of writing).
Note that we package/ship libcouchbase separately from the cluster. Generally when doing Python development, you’ll want to install that (as the instructions indicate) since it is updated at a more regular cadence and that package puts headers/etc. in the right place for development.