简体   繁体   中英

Trouble installing cx_Oracle - Python?

I have been trying to install cx_Oracle using PyCharm, it was installed successfully but I import and run the script I get the following error:

DPI-1047: Cannot locate a 64-bit Oracle Client library: "The specified module could not be found". See https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html for help

How do I solve this?

It is now referring to the instance client for oracle that you will need to point to in your code.

Please read the the docs .

The code should look something like this:

import cx_Oracle
cx_Oracle.init_oracle_client(lib_dir=r"C:\oracle\instantclient_19_6")

I think you need to point the client to your code so that it can connect to oracle databases. I tried this -

first i installed the library using pip

->pip install cx_Oracle

then i imported the library and used its function 'init_oracle_client' to point my file as the client.

import cx_Oracle as oc

oc.init_oracle_client(lib_dir=r)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM