Search code examples
pythonoracle-databasecx-oracle

Toad is working properly but not cx_oracle


I have installed Oracle Client 12.2.0 on my desktop and my laptop. When I am using TOAD, everything is working fine in both of them. However, when using cx_Oracle in Jupyter Notebook with my desktop, I get this error: "DPI-1047: Cannot locate a 64-bit Oracle Client library". Interestingly, I do not get this error on my laptop at all. On both of them, my python is 64-bit while the oracle client is 32-bit.

I am wondering why I am getting this error in just one of them. I almost used all the solutions in different posts but none of them worked.

Any ideas?


Solution

  • Here is the solution I found for my problem:

    1. Download 64-bit version of oracle instantClient from: https://www.oracle.com/database/technologies/instant-client/winx64-64-downloads.html
    2. Copy the dll files in the instantclient directory to the python directory, as shown below

    enter image description here

    enter image description here

    That is it!