The process of installing Oracle drivers into Python is complex. To use Python with Oracle
three components must all be inplace and be of the same version (Python 3.5 suggested)
and architecture (64-bit suggested). This tutorial assumes that you desire a Python 3.5
instance running in 64-bit. To do this, you must have installed:
- Part 1: Anaconda Python 3.5 (64-bit)
- Part 2: cx_Oracle for Python 3.5 (64-bit)
- Part 3: Oracle 64-bit Instant Client (64-bit)
That perfect chain of 64-bit and Python 3.5 cannot be broken or you get a series of very
cryptic error messages. RGA INSTALLS 16-bit Oracle on Most Machines. This is a problem,
but it can be worked around.
Run the following cell to determmine what sort of Python you have.
Make sure that the below says you are running 3.x, Anaconda and 64-bit. Note that you
have a Python version and an Anaconda Verison. Python version is displayed first.
First, see what version of Python you have installed and how many bits.
This should respond something like this:
Next you will need to install a binary of the cx_Oracle Python driver. This the Python
side of things and interfaces Python to the actual Oracle driver (that is installed in
Step 3). Issue the below command to the command line.
You can also download a binary image directly, this is usually not necessary on Windows.
The link below takes you to binary images:
Python needs a 64-bit Oracle driver. Download the Oracle 12 instant client.
- Oracle 12 64-bit Windows Instant Client - Choose first link
The above link requires you to have an Oracle ID. If you wish to just obtain the file,
you can get it from the following RGA share:
This is simply a zip file, I suggest unzipping it to c:\Oracle\, this will create a directory such as:
Now it is time to test the drive. If you can execute the following command, and not get
an error, then you have successfully configured Oracle for Python.