DLL load failed: The specified module could not be found (Windows 10)


I have been getting the same error anytime I run my script.

Traceback (most recent call last):
File “c:/Users/13474/Pipeline/pipeline.py”, line 4, in
import couchbase.subdocument as SD
File “C:\Users\13474\Anaconda3\lib\site-packages\couchbase_init_.py”, line 1, in
import couchbase_core.bootstrap
File "C:\Users\13474\Anaconda3\lib\site-packages\couchbase_core_init
.py", line 40, in
import couchbase_core._libcouchbase as _LCB
ImportError: DLL load failed: The specified module could not be found.

I am running on Windows 10 (Home), using Python 3.7.4 (Anaconda3). What am I missing?

Hi, this looks like a known issue, with a fix due to be released soon in 3.0.4. In the meantime, you can install a prerelease as follows:

pip install couchbase==3.0.4b1

Hope that helps,


Thanks for your response.
I tried this and this did not solve the issue for me. I am still getting the same message.

Thanks @sgorok - is there any warning message prior to this exception? The previous reason this failed was when OpenSSL symbols had not been loaded prior to pulling in libcouchbase.

Please could you tell us the exact version of Anaconda you are using and any other details of the system, so that we can reproduce and fix this? A reproduction script may also be useful (though this seems a fairly fundamental issue).

Though we will be trying this here, you can also help us by running the ‘dependencies’ tool on couchbase_core\_libcouchbase.pyd and couchbase_core\libcouchbase.dll in your conda environment’s site-packages directory, and look for missing symbols (flagged up with a question mark, usually).

It may be necessary to add DLL search paths that conda activate will set up - perhaps running depends.exe from within an activated conda prompt will help here.
This should leave us with a more accurate view of what. the Python interpreter sees and hopefully tell us why the DLL import failed.



While I run the dependencies tool, here are more details regarding my environment:
Anaconda 2019.10 (build channel: py37_0)
conda version 4.8.3, conda-build version 3.18.9
Python 3.7.4.
|OS Name|Microsoft Windows 10 Home|
|Version|10.0.19041 Build 19041|

Missing (?) modules:


I have run into the same error, using version 3.0.3 of the Python SDK. For me, installing version 3.0.4b1 did work. Just adding this as a data point.



1 Like

Hi, does this still happen with the 3.0.4 full release?

What happens if you manually run

import ssl
import couchbase




Sorry for not responding sooner. Given that 3.0.5 is available now, this may be irrelevant. If I manually run the commands you list, using version 3.0.4, nothing happens:

Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> import couchbase


Hi, that’s good. import ssl should load the OpenSSL libraries libcouchbase requires - in 3.0.4 and beyond this should happen automatically on import of the couchbase package, but perhaps there are some edge cases where it does not. Any information on the setup in question may help us to reproduce this if it is still an issue in 3.0.5. The workaround is of course to do this explicitly before importing any couchbase module.

Didn’t work for me :frowning:
Adding this as a data point. My python is: 3.8.3
Miniconda version: 4.8.5

Did that issue resolved? what was the solution. I am facing the same error even using the import:
I am using the couchbase 6.0 and conda 3.7.
from couchbase.cluster import Cluster, ClusterOptions, QueryOptions
from couchbase_core.cluster import PasswordAuthenticator
import ssl
from couchbase_core import _libcouchbase


import couchbase_core._libcouchbase as _LCB
ImportError: DLL load failed: The specified module could not be found.

Please let me know if anyone found workaround.

Ty for quick reply. but seems the same error with suggested script also
Ran pip install couchbase==3.0.4b1
from couchbase.cluster import Cluster, ClusterOptions, QueryOptions

ended with same error

This is an issue for us with anaconda/miniconda. It seems the loading of c extensions is problematic. We have an open bug on this (actually, I think more that one). If you use the python from python.org, for instance, this isn’t an issue. But, for now, we have this bug if you use anaconda.

Hi @davidkelly Any possible timelines for this bug-fix.
We need it via anaconda as many of the ML libraries are needed which are majorly supported via Anaconda.


1 Like

Hi @davidkelly ,
I have the same problem that @vizzyno1 and also need the 3.8 python with anaconda (not the python 3.8 from python.org).
Do you please have idea of possible timelines ?
Many thanks!

@vizzyno1 @Louis - I’m checking on this – will update you with a timeline when I get it.

When you are in the anaconda prompt, it uses a different pip3 than the pip3 that exists outside anaconda. On my Mac, when I do pip3 install couchbase, it installs it, and a subsequent python3 <some script>.py finds everything, connects to couchbase servers.

We verified it working fine on both linux and OS X today. Will try windows shortly, and will update here when we have something.

It looks like the environment variables have become corrupt after the update. The solution is to provide the python interpreter with the path-to-your-module. The simplest solution is to append that python path to your sys.path list. In your notebook, first try:

import sys

This isn’t a permanent change in sys.path, because when you log out, your environment is reset, so any variables you may have set are lost.

The better (and more permanent) way to solve this is to set your PYTHONPATH, which provides the interpreter with additional directories look in for python packages/modules.

from BASH type: export PYTHONPATH=/path/to/new/folder:/another/path/...../
#each path must be separated by a colon

Hello @davidkelly , do you have any update on the anaconda 3.8 couchbase issue please ?
Many thanks.