These installation instructions assume that you are on 64-bit Windows and have a Windows x64 Oracle 11gR2 database running on your machine. The Oracle database can be on any edition of Oracle (Express, Standard, Enterprise). If you are running a Windows x32 version of the Oracle database, but your machine is on 64-bits, you should first install Windows x64 of Oracle before proceeding with this tutorial.
Note that Oracle Express 11gR2 for Windows x64 can be downloaded from http://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html
Step 1-download and install Python for 64-bit Windows
-go to URL: https://www.python.org/downloads/windows/
-scoll down the list until you see Python 2.7.1 - 2010-11-27
-download Windows x86-64 MSI installer (filename: python-2.7.1.amd64.msi)
-go through the installer by accepting all the defaults. The install directory will be C:\Python
-once the installation is complete, add the following locations to the windows PATH variable: C:\Python and C:\Python\Lib\site-packages
-open a command window and launch the python interpreter by running 'python' on the command-line prompt
you should get:
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:16:31) [MSC v.1600 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
Step 2-download and install the Oracle driver for Python called cx_Oracle
-go to URL: https://pypi.python.org/pypi/cx_Oracle/5.1.3
-select and download cx_Oracle-5.1.3-11g.win-amd64-py2.7.exe (md5) (filename: cx_Oracle-5.1.3-11g.win-amd64-py2.7.exe)
-run through the cx_Oracle installer by accepting all the defaults. The installer should detect the existing Python installation under C:\Python
-open a new command window and bring up the python interpreter as before by running 'python'
-run: import cx_Oracle
you should get:
C:\Users\shir7084>python
Python 2.7.1 (r271:86832, Nov 27 2010, 17:19:03) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import cx_Oracle
>>> con = cx_Oracle.connect('ap/ap@127.0.0.1/xe')
>>> print con.version
11.2.0.2
>>> con.close()
Note: if you get the output 11.2.0.2 or 11.2.0.3 or 11.2.0.4 from the above test, then you are good. If you get an error, please post the entire output on Piazza including the error.