2

Hy I try to connect with my oracle database but I have error. I'm a beginner in python i try find answer in documentation but It to hard for me.

Python version :
Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] on win32

Oracle version :
11.2.0.1.0

My cod is simple :

    from sqlalchemy import create_engine
    import cx_Oracle
    
    
    engine =  create_engine('oracle://user:password@ho.st.name:port/SID')
    result = engine.execute('select * FROM TABLE')

In result I get an error :

    Exception has occurred: DatabaseError
    (cx_Oracle.DatabaseError) DPI-1047: Cannot locate a 64-bit Oracle Client library: "The specified module could not be found".
Christopher Jones
  • 9,449
  • 3
  • 24
  • 48
Błażej
  • 125
  • 2
  • 11
  • 1
    When in doubt, read the manual: [Installing cx_Oracle on Windows](https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html#installing-cx-oracle-on-windows). The DPI-1047 should have given you a URL with installation instructions. – Christopher Jones Sep 07 '20 at 23:04

2 Answers2

2

The Python cx_Oracle library is dependent of Oracle Client library.

Download the Oracle Client library from here : https://www.oracle.com/database/technologies/instant-client.html

Best of luck!

Bjarte Brandt
  • 4,191
  • 2
  • 23
  • 25
1

Looks like the library has not been installed properly. Refer cx_Oracle error. DPI-1047: Cannot locate a 64-bit Oracle Client library

To install cx_Oracle

python -m pip install cx_Oracle --upgrade
Vivs
  • 447
  • 4
  • 11