Python 2.7.9 (default, Jun 2 2016, 16:37:17)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
import couchbase
import couchbase.subdocument
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named subdocument
Upgrade your python client as well.
2.6.0 seems too old as well (I’d need to check).
Your cbc version output suggests you have multiple installs of libcouchbase. Perhaps check that you don’t have any lingering installs in /usr/local or similar.
Your cbc is not using the same runtime it was compiled. The output shows it’s using 2.7.4 headers against a 2.6.0 runtime. This isn’t an error per se, but something to be aware of.
The couchbase.subdocument module was added in our Python client version 2.0.8 - a bit over a year ago.
Yes, the subdocument API is designed specifically for that purpose. You can use traditional full-document upsert/insert/replace etc. if you want to change the contents of the entire document.
The ImportError you’re getting is simply because the module doesn’t exist in the Python client you’re using. There may be other reasons - but those are all related to how you’ve set up your Python project.