I have been trying to get the DictCursor working with mysqldb module
but can't seem to. I have pasted the basic connection code and the
traceback from pydev. The connection does open with the default cursor
class. can&#39;t figure out how to use the dict cursor class instead of the default one. many thanks.<br>
<br>&lt;code&gt;<br>import MySQLdb<br>import sys<br># connect to the MySQL server<br>try:<br>&nbsp;&nbsp;&nbsp; conn = MySQLdb.connect(host=&quot;localhost<div id="1g33" class="ArwC7c ckChnd">&quot;,read_default_file=&#39;~/.my.cnf&#39;,db=&#39;test&#39;,cursorclass=MySQLdb.cursors.DictCursor)<br>

&nbsp;&nbsp;&nbsp; cur = conn.cursor()<br>&nbsp;&nbsp;&nbsp; print conn<br>except MySQLdb.Error, e:<br>&nbsp;&nbsp;&nbsp; print &quot;Error %d: %s&quot; % (e.args[0], e.args[1])<br>&nbsp;&nbsp;&nbsp; sys.exit (1)<br>&lt;/code&gt;<br><br>Traceback (most recent call last):<br>&nbsp; File &quot;/Users/.....src/db/test.py&quot;, line 7, in ?<br>

&nbsp;&nbsp;&nbsp; conn = MySQLdb.connect(host=&quot;localhost&quot;,read_default_file=&#39;~/.my.cnf&#39;,db=&#39;te<br>st&#39;,cursorclass=MySQLdb.cursors.DictCursor)<br>AttributeError: &#39;module&#39; object has no attribute &#39;cursors&#39;</div>