Python SQLAlchemy: Data source name not found and no default driver specified
<p>Using Python: when connecting to SQL Server using pyodbc, everything works fine, but when I switch to sqlalchemy, the connection fails, giving me the error message:</p>

<pre><code>('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')
</code></pre>

<p>My code:</p>

<pre><code>cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=servername;DATABASE=dbname;UID=username;PWD=password')
engine = sqlalchemy.create_engine("mssql+pyodbc://username:password@servername/dbname")
</code></pre>

<p>I can't find the error in my code, and don't understand why the first options works, but the second doesn't.</p>

<p>Help is highly appreciated!</p>