title: pyodbc.Error 'IM002' connecting to DB2
body: <p>I downloaded Python 2.7 (<em>python-2.7.1.amd64.msi</em>) and pyodbc, the python extension module for connecting to DB2 database (i.e. <em>pyodbc-2.1.8.win-amd64-py2.7.exe</em>).</p>
  
  <p>I wrote sample script as shown below.</p>
  
  <pre><code>import csv 
  import pyodbc 
  conn = pyodbc.connectpyodbc.connect('DRIVER={DB2};SERVER=localhost;DATABASE=DBT1;UID=scott;PWD=tiger;')  
  curs = conn.cursor() 
  curs.execute('select count(edokimp_id) from edokimp') 
  print curs.fetchall() 
  </code></pre>
  
  <p>The script throws following error</p>
  
  <pre><code>pyodbc.Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnectW)')
  </code></pre>
  
  <p>As I am a newbie to Python, I realized from the error that I need to download the IBM DB2 driver for pyodbc and hence searched extensively on Google but couldn't find any.</p>
  
  <p>I would greatly appreciate if you could point me to the site where I can download the driver and later explain me how to configure/load the driver.</p>
  
  <p>In case of Java </p>
  
  <ul>
  <li>the driver will be shipped in the form of <em>ojdbc.jar</em> which will be copied to the <em>lib</em> directory which will be on classpath</li>
  <li>make changes to configuration file</li>
  <li>reference the DataSource from Java Class</li>
  </ul>
  
  <p>I am newbie to Python so I would greatly appreciate if you could let me know cooresponding steps with an example in Python.</p>