im trying to use oracledb to connect to the database from python, but i get the error:
ORA-28759: failure to open file
My code is the standard connection code:
import oracledb
oracledb.init_oracle_client(lib_dir=r"C:\oracle\instantclient_18_5")
dbadw = """###fromtnsnames"""
connx = oracledb.connect(user='my_user', password ='my_password',dsn=dbadw , encoding="UTF-8")
c= connx.cursor()
without initializing oracle_client the error im getting is:
DPY-6005: cannot connect to database (CONNECTION_ID=r+tcRVTAlqmL/bxaTd38UA==).
DPY-6000: Listener refused connection. (Similar to ORA-12506)
The user im using to connect to the database is not administrator but i checked that i can open and write files and write files in the wallet directory
Im using jupyter notebook
I also tried with cx_Oracle, but pip install cx_Oracle throws error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools" which i cannot install since im not admin. I checked many other posts on this same error but i didn´t get anywhere
Any other info i can give to solve this let me know Thanks in advance!
The error
ORA-28759: failure to open fileis generally due to the fact that yoursqlnet.orafile doesn't have a valid value in itsWALLET_LOCATIONentry. This must be the directory in which the filecwallet.ssois found.The error
DPY-6005with the phraseSimilar to ORA-12506raised in thin mode is telling you a similar thing. In thin mode you must specify the location of the wallet in thewallet_locationparameter. You also (by default) need to specify thewallet_passwordparameter.The documentation for connecting to Cloud databases should cover any remaining questions you might have!