DLL load failed while importing pycbc_core: The specified module could not be found

Hello everyone,
I have an error while trying to run a python file (having a streamlit code)
in the file excpetions.py, there’s this line of code

from couchbase.pycbc_core import exception

I have the following error :
DLL load failed while importing pycbc_core: The specified module could not be found.

Is there any solution for this please?

Hi @rafik.hammoutene - Could you provided more information? The following is usually a helpful start:

  • Provide the version of the Python SDK are you using
  • Provide details on your environment (Operating System, Python Version, etc)
  • Provide a small code example that demonstrates the issue

Based on the 2nd point, have you followed all the requirements described in the installation docs here?

Hey @jcasey

I have the latest Python SDK
Python 3.8.8

I have installed the server, everything was working until I decided to debug a file.
Here’s the file (it’s just connecting to the server and printing a result of a query)

from ast import Pass
from datetime import timedelta
from couchbase.auth import PasswordAuthenticator
from couchbase.cluster import Cluster

from couchbase.options import ClusterTimeoutOptions,ClusterOptions
from couchbase.exceptions import CouchbaseException
from bunch_funcs import get_docs_ids


#cluster = Cluster.connect("couchbase://localhost", ClusterOptions(PasswordAuthenticator("", "")))
USERNAME=""
PASSWORD=""
BUCKET_NAME="companies_data"

auth=PasswordAuthenticator(USERNAME,PASSWORD)

cluster=Cluster(
        'couchbase://127.0.0.1',
        ClusterOptions(auth)
)

bucket=cluster.bucket(BUCKET_NAME)
collection=bucket.default_collection()
id=get_docs_ids()[0]
#query="SELECT founded_year FROM `companies_data`._default._default WHERE _id="+id
# #resultat=cluster.query(query)
# for row in resultat.rows():
#         print(row['_id']+'he')

query="SELECT founded_year FROM `companies_data`._default._default WHERE _id="+"'"+id+"'"
resultat=cluster.query(query)
for row in resultat.rows():
        print(row['founded_year'])

(I 've hidden the username and password )

Hi @rafik.hammoutene - What operating system are you using? Typically this issue is seen when OpenSSL 1.1 is not installed. It is a requirement for the SDK (mentioned in the installation docs). Can you confirm you have OpenSSL installed? Should be able to run the following and see similar output.

$ openssl version -a

OpenSSL 1.1.1s  1 Nov 2022 (Library: OpenSSL 1.1.1q  5 Jul 2022)
built on: Tue Jul  5 09:08:33 2022 UTC
platform: darwin64-arm64-cc
options:  bn(64,64) rc4(int) des(int) idea(int) blowfish(ptr)
compiler: clang -fPIC -arch arm64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -D_REENTRANT -DNDEBUG
OPENSSLDIR: "/opt/homebrew/etc/openssl@1.1"
ENGINESDIR: "/opt/homebrew/Cellar/openssl@1.1/1.1.1q/lib/engines-1.1"
Seeding source: os-specific

Also, for reference, we provide some Dockerfiles as a guideline to installation on various platforms. See Dockerfiles here.

Hey @jcasey , I’m using Windows (11), I do have OpenSSL installed !
I’ve resolved the issue ! Thanks for your time

I have had the same issue as above, with OpenSSL installed.

This appears to be a fault in Python version 3.11.5.

Downgrading to Python 3.11.4 removes the issue.