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

Hello,

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,

Ellis

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.

Thanks,

Ellis

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:
libssl-1_1.dll
libcrypto-1_1.dll
ext-ms-win-oobe-query-11-1-0.dll
ext-ms-win-core-winrt-remote-11-1-0.dll
ext-ms-win-security-chambers-11-1-0.dll

Hi,

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.

Thanks,

James

1 Like

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

What happens if you manually run

import ssl
import couchbase

Thanks,

Ellis

Hi,

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
>>>

James

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.