Couchbase-3.1.0 on CentOS 7 ImportError: libcouchbase.so.7: cannot open shared object file: No such file or directory

[root@hostname venv]# source bin/activate
(venv) [root@hostname venv]# python
Python 3.7.3 (default, Jun 21 2019, 22:44:58)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

exit()
(venv) [root@hostname venv]# pip3 install couchbase
Collecting couchbase
Downloading https://files.pythonhosted.org/packages/4c/d1/971a65b7df04caf2556e13ad3d37c5813cc593fbd925195651d35930b982/couchbase-3.1.0.tar.gz (1.5MB)
100% |████████████████████████████████| 1.5MB 12.2MB/s
Installing build dependencies … done
Getting requirements to build wheel … done
Installing backend dependencies … done
Preparing wheel metadata … done
Collecting typing-extensions; python_version < “3.8” (from couchbase)
Using cached https://files.pythonhosted.org/packages/60/7a/e881b5abb54db0e6e671ab088d079c57ce54e8a01a3ca443f561ccadb37e/typing_extensions-3.7.4.3-py3-none-any.whl
Collecting mypy-extensions (from couchbase)
Using cached https://files.pythonhosted.org/packages/5c/eb/975c7c080f3223a5cdaff09612f3a5221e4ba534f7039db34c35d95fa6a5/mypy_extensions-0.4.3-py2.py3-none-any.whl
Collecting six (from couchbase)
Using cached https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl
Collecting attrs>=19.1.0; python_version > “3.5” (from couchbase)
Using cached https://files.pythonhosted.org/packages/c3/aa/cb45262569fcc047bf070b5de61813724d6726db83259222cd7b4c79821a/attrs-20.3.0-py2.py3-none-any.whl
Collecting wrapt>=1.11.2 (from couchbase)
Using cached https://files.pythonhosted.org/packages/82/f7/e43cefbe88c5fd371f4cf0cf5eb3feccd07515af9fd6cf7dbf1d1793a797/wrapt-1.12.1.tar.gz
Collecting pyrsistent>=0.15.2 (from couchbase)
Using cached https://files.pythonhosted.org/packages/4d/70/fd441df751ba8b620e03fd2d2d9ca902103119616f0f6cc42e6405035062/pyrsistent-0.17.3.tar.gz
Building wheels for collected packages: couchbase
Building wheel for couchbase (PEP 517) … done
Stored in directory: /root/.cache/pip/wheels/6e/df/1c/a810d7bb085bf6f6a19406eb370d5eb13c161e98c5d7a1b48f
Successfully built couchbase
Installing collected packages: typing-extensions, mypy-extensions, six, attrs, wrapt, pyrsistent, couchbase
Running setup.py install for wrapt … done
Running setup.py install for pyrsistent … done
Successfully installed attrs-20.3.0 couchbase-3.1.0 mypy-extensions-0.4.3 pyrsistent-0.17.3 six-1.15.0 typing-extensions-3.7.4.3 wrapt-1.12.1
You are using pip version 19.0.3, however version 21.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.
(venv) [root@hostname venv]# ll
total 4
drwxr-xr-x. 2 root root 190 Apr 26 19:50 bin
drwxr-xr-x. 2 root root 6 Apr 26 19:50 include
drwxr-xr-x. 3 root root 23 Apr 26 19:50 lib
lrwxrwxrwx. 1 root root 3 Apr 26 19:50 lib64 → lib
-rw-r–r–. 1 root root 75 Apr 26 19:50 pyvenv.cfg
(venv) [root@hostname venv]# python
Python 3.7.3 (default, Jun 21 2019, 22:44:58)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
import couchbase
Traceback (most recent call last):
File “”, line 1, in
File “/root/venv/lib/python3.7/site-packages/couchbase/init.py”, line 1, in
import couchbase_core._bootstrap
File “/root/venv/lib/python3.7/site-packages/couchbase_core/init.py”, line 45, in
import couchbase_core._libcouchbase as _LCB
ImportError: libcouchbase.so.7: cannot open shared object file: No such file or directory

Anyone experiences the same issue?

Hi @Joey_Wang – this was fixed in 3.1.1 (released yesterday). Release notes here.

thanks @jcasey , that’s great.

@jcasey ,
is the couchbase link in pip broken again?

from couchbase.cluster import Cluster, PasswordAuthenticator
Traceback (most recent call last):
File “”, line 1, in
File “/home/ec2-user/.local/lib/python3.7/site-packages/couchbase/cluster.py”, line 5, in
from couchbase.management.queries import QueryIndexManager
File “/home/ec2-user/.local/lib/python3.7/site-packages/couchbase/management/queries.py”, line 8, in
from couchbase_core._pyport import Protocol
ImportError: cannot import name ‘Protocol’ from ‘couchbase_core._pyport’ (/home/ec2-user/.local/lib/python3.7/site-packages/couchbase_core/_pyport.py)

1 Like

i am seeing the same issue. it started this weekend. was working untill last friday. Any help is appreciated!!

The issue that we were seeing on GCP dataproc and the issue turned out to be the debian version . We were seeing this issue with 1.5.4-debian10. Changed it to 1.5.35-debian10 and it is working properly. Hopefully this info turns to be helpful

it occurs on my CentOS 7 from last Friday.

according to https://issues.couchbase.com/browse/PYCBC-1120,

the following can be a workaround:
pip install typing-extensions==3.7.4.3

1 Like

Hi @Ajith_k.p & @Joey_Wang ,

The typing-extensions package made an update over the weekend. This will be corrected in the 3.1.2 SDK release (hoping to have that out by today, early next week at the latest).

@Joey_Wang is correct on the work-around in the interim → move typing-extenstions to v 3.7.4.3.

1 Like