How can I get the import cx_Oracle line to work in Python 3.5?

时间:2016-02-12 19:34:49

标签: python oracle oracle11g

I am on a Windows 7 (64-bit) machine. I connect to Oracle 11g. When I start my Python shell it shows the following:

Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] on win32

I initially installed the 32-bit version of cx_Oracle for 11g. When in the shell and typing 'import cx_Oracle' I got a 'no such module found'.

I went and uninstalled cx_Oracle via Control Panel>Programs and Features. It did mention that not all files/directories were able to be removed.

I then installed the 64-bit version of cx_Oracle; cx_Oracle-5.2.1-11g.win-amd64-py3.5.exe (md5). A 'pip install cx_Oracle' in PowerShell indicated that the install had been successful.

Now when in the Python shell and typing in 'import cx_Oracle' I get the following error: DLL load failed: %1 is not a valid Win32 application.

What might I need to do to get the import cx_Oracle to work for me?

UPDATE: Apparently the Oracle client I have installed is 32-bit. I've read that this could be an issue with this import call given that my Python and cx_Oracle installs are 64-bit....does the import call check what Oracle client I have on my machine, thus this error?

0 个答案:

没有答案