Python Forum
Unable to connect oracle database using python code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to connect oracle database using python code
#1
I'm getting below error while trying to connect oracle database in python code. could someone help:

>>> import cx_Oracle
>>> connection = cx_Oracle.connect('system/welcome123@orcl')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
cx_Oracle.DatabaseError: DPI-1047: 32-bit Oracle Client library cannot be loaded: "C:\app\mayugupt\product\12.1.0\dbhome_1\bin\oci.dll is not the correct architecture". See https:/
/oracle.github.io/odpi/doc/installation.html#windows for help
>>>
>>>
Reply
#2
Error messages should be interpreted -- That's what they are there for.

Quote:wrong dll: C:\app\mayugupt\product\12.1.0\dbhome_1\bin\oci.dll is not the correct architecture
see: https://oracle.github.io/odpi/doc/instal...ml#windows

And on that site:

Quote:ODPI-C requires Oracle Client libraries, which are found in Oracle Instant Client, or an Oracle Database installation, or in a full Oracle Client installation. The libraries must be either 32-bit or 64-bit, matching your application and ODPI-C library (if one is created separately).

On Windows, ODPI-C searches for the Oracle Client library “OCI.dll” using the standard library search order.

Oracle Client libraries require the presence of the correct Visual Studio redistributable.

11.2 : VS 2005 64-bit or VS 2005 32-bit
12.1 : VS 2010
12.2 : VS 2013
the last bunch of fields are links, most likely what you need to download and install.
Reply
#3
Thanks for your help !!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Unable to understand the meaning of the line of code. jahuja73 0 303 Jan-23-2024, 05:09 AM
Last Post: jahuja73
  connect sql by python using txt. file dawid294 2 427 Jan-12-2024, 08:54 PM
Last Post: deanhystad
  How to Connect to PostgreSQL Through Jump Server and SSH Tunnel using Python? nishans 1 967 Jan-02-2024, 10:37 AM
Last Post: khanzain
  python connect to mssql wailoonho 7 1,556 Dec-07-2023, 02:06 AM
Last Post: wailoonho
  Using Python to connect to an XML ? jehoshua 12 1,964 Jul-11-2023, 12:34 AM
Last Post: jehoshua
  Trying to make a bot to connect on discord with Selenium Python johnsmith43 2 50,009 Mar-21-2022, 02:56 PM
Last Post: Cloudytechnical
Photo Visual studio code unable to color syntax on python interpreter tomtom 4 6,866 Mar-02-2022, 01:23 AM
Last Post: tomtom
  Encrypting Oracle Passwords / Python Library for That? bmccollum 1 2,573 Jun-11-2021, 07:59 PM
Last Post: Larz60+
  Connect and disconnect to database snakes 3 2,249 Jun-06-2021, 12:03 PM
Last Post: jefsummers
  Unable to understand how given code takes a fixed input value, without inputting. jahuja73 4 2,693 Jan-28-2021, 05:22 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020