This is kind of nontrivial. However doable. Follow these steps:
1) Download the Oracle Instant Client for Windows x64 from
http://www.oracle.com/technetwork/topics/winx64soft-089540.html
eg. choose a client, for example. 11.2.0.4
-> instantclient-basic-windows.x64-11.2.0.4.0.zip
-> instantclient-sdk-windows.x64-12.1.0.2.0.zip
2) Create a directory and unzip the client and sdk:
eg. C: \ op \ 11gx64
3) Set ORACLE_HOME and TNS_ADMIN
See https://superuser.com/questions/949560/how-do-i-set-system-environment-variables-in-windows-10 for details
eg. ORACLE_HOME = C: \ ora \ 11gx64
and TNS_ADMIN = c: \ ora \ 11gx64
also add% ORACLE_HOME% to your% PATH%
4) In the created directory, put the tnsnames.ora file and fill in the db connection string:
% ORACLE_HOME% ** tnsnames.ora **
XE = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE) ) )
-> replace 127.0.0.1 with your hostname
-> replace XE with SID
5) Suppose you already have Python installed.
-> Otherwise, visit the download page for Python
-> Install python (3.6.1 at time of writing)
-> If install pip is not installed ( https://pip.pypa.io/en/stable/installing/#do-i-need-to-install-pip )
-> execute python get-pip.py
6) Download and install Visual C ++ 2015 Build Tools
-> Visual C ++ 2015 Build Tools Search → Install visualcppbuildtools_full.exe
7) Use pip to install cx_oracle
pip install cx_oracle
(during recording, there is a problem with the default version 5.3 installed, so you need to install version 6.0b2)
python -m pip install cx_Oracle
The first steps are universal in my honest opinion for both conda and pip.