0

I want to connect python and oracle 11g. Python Version- 3.6.1 / 64 bit, Windows 7 -64 bit.

I have installed cx_Oracle from https://oracle.github.io/python-cx_Oracle/ The Code is as below -

import cx_Oracle

con = cx_Oracle.connect('sde/sde@orcl')
print (con.version)
con.close()

But I am getting below Error -

C:\Python\Python36\python.exe 
D:/Automation/Python_WP/practice/database/db_connection.py
Traceback (most recent call last):
File "D:/Automation/Python_WP/practice/database/db_connection.py", line 1, in <module>
import cx_Oracle
ImportError: DLL load failed: The specified module could not be found.

Process finished with exit code 1

Please let me know the steps to connect Python 3.6.1 and Oracle 11g for Windows-7 64 bit.

9
  • did you installed it with pip or downloaded it? Commented May 5, 2017 at 9:36
  • I have installed cx_Oracle-5.3-11g.win-amd64-py3.6-2.exe (md5). Commented May 5, 2017 at 10:06
  • use pip install cx_Oracle and try. hope it will resolve this error Commented May 5, 2017 at 10:07
  • C:\Python\Python36>pip install cx_Oracle Requirement already satisfied: cx_Oracle in c:\python\python36\lib\site-packages Commented May 5, 2017 at 10:44
  • I have also download the Oracle instant Client. << nstantclient-basic-windows.x64-11.2.0.3.0.zip >> and unzip it. Set this path to Environment Variable . ORACLE_HOME:C:\instantclient\instantclient Then install cx_Oracle <> But Still its not working. ImportError: DLL load failed: The specified module could not be found. Facing above error. Commented May 8, 2017 at 10:26

1 Answer 1

1
1. Download msvcp71.dll and msvcr71.dll from the web.
2. Save them to your C:\Windows\System32 folder.
3. Save them to your C:\Windows\SysWOW64 folder as well (if you have a 64-bit operating system).

Now try running your code file in Python and it will load the graph in couple of seconds.

Sign up to request clarification or add additional context in comments.

1 Comment

In my system Windows 7, Python 3.6.1 and Oracle 11.2.0.3.0 are 64 bit. I have the following - 1. Download msvcp71.dll and msvcr71.dll from the web. 2. Save them to your C:\Windows\System32 folder. 3. Save them to your C:\Windows\SysWOW64 folder as well 4. Download instantclient-basic-nt-11.2.0.3.0.zip and set up this path in Environment variable -> System Variable -> path. Also in the same directory i have paste msvcr100.dll file 5. Download and install cx_Oracle-5.3-11g.win-amd64-py3.6-2.exe But still import cx_Oracle is showing error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.