After upgrading from Couchbase 6.0.0 to 6.6.0, couchbase-cli no longer works. I get the error:
Traceback (most recent call last):
File “/opt/couchbase/lib/python/couchbase-cli”, line 8, in
File “/opt/couchbase/lib/python/cbmgr.py”, line 17, in
from argparse import ArgumentError, ArgumentParser, HelpFormatter, Action, SUPPRESS
ImportError: bad magic number in ‘argparse’: b’\x03\xf3\r\n’
I can see there are .pyc files in /opt/couchbase/lib/python that are left over from the 6.0.0 install. I think couchbase-cpi is trying to use these. In particular, the file /opt/couchbase/lib/python/argparse.pyc is causing the problem here. I ran
rm /opt/couchbase/bin/python/*.pyc and couchbase-cli then worked.
I think an upgrade should automatically delete all existing *.pyc files before unpacking the new files.