title: Deploying cx_Oracle in Windows
body: <p>I'm trying to use <code>cx_Oracle</code> module in python to access a remote database and insert or delete rows in tables. BTW I have downloaded oracle instant client 11.1 and also odbc and sqlplus versions. I have set environment variables <code>ORACLE_HOME</code> and <code>TNS_ADMIN</code> to directory I have unzipped files there and add this this directory to the <code>PATH</code> variable. As I googled I think there should be some <code>.ora</code> files but I can't find them. </p>
  
  <p>I can use <code>sqlplus</code> commands from command line, but my main problem is that I can't install and use <code>cx_Oracle</code>. I don't want to use any command line scripts; I just want to use <code>cx_Oracle</code> as an API.</p>
  
  <p>Can anyone give me a complete explanation, I'm really stuck there. All the documents in this area are vague. Best Regards.</p>
  
  <p><strong>EDIT 1:</strong></p>
  
  <p>I tried the source package of <code>cx_Oracle</code> with <code>python setup.py install</code> and <code>python setup.py build --compiler=mingw32</code> commands. I don't get the oracle error again, but I'm getting <code>command 'gcc' failed</code> error. I tried MinGW compiler and have edited environment variable <code>PATH</code> to contain MinGW install directory(e.g. <code>C:\MinGW</code>); I have also installed Microsoft Visual C++(versions 2005, 2008 and 2010); but I still get the error.</p>
  
  <p><strong>EDIT 2:</strong></p>
  
  <p>Since @jpmc26 mentioned about <code>tnsnames.ora</code> files, I decided to add that I have tried to make a <code>tnsnames.ora</code> and also a <code>sqlplus.ora</code> file and put them in directory <code>C:\oracle\instant_client_11_1\network\admin</code>; but as I googled I realized that if you use <code>cx_Oracle.connect(username, password, cx_Oracle.makedsn(ip, port, sid))</code> command, you can skip <code>.ora</code> files. <code>cx_Oracle.makedsn</code> would make the structure itself.</p>