title: AttributeError: module 'odbc' has no attribute 'connect' - python with pydev
body: <p>I am very new to python and I just can't seem to find an answer to this error. When I run the code below I get the error</p>
  
  <pre><code>AttributeError: module 'odbc' has no attribute 'connect'
  </code></pre>
  
  <p>However, the error only shows in eclipse. There's no problem if I run it via command line. I am running python 3.5. What am I doing wrong? </p>
  
  <pre><code>try:
      import pyodbc
  except ImportError:
      import odbc as pyodbc
  
  # Specifying the ODBC driver, server name, database, etc. directly
  cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=PXLstr,17;DATABASE=Dept_MR;UID=guest;PWD=password')
  </code></pre>
  
  <p>The suggestion to remove the try...except block did not work for me. Now the actual import is throwing the error as below:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\a\workspace\TestPyProject\src\helloworld.py", line 2, in &lt;module&gt;
      import pyodbc
    File "C:\Users\a\AppData\Local\Continuum\Anaconda3\Lib\site-packages\sqlalchemy\dialects\mssql\pyodbc.py", line 105, in &lt;module&gt;
      from .base import MSExecutionContext, MSDialect, VARBINARY
  </code></pre>
  
  <p>I do have pyodbc installed and the import and connect works fine with the command line on windows.</p>
  
  <p>thank you</p>