title: Python - Can't open lib 'libtdsodbc.so' : file not found
body: <p>Any help with this issue is much appreciated.</p>
  
  <p>Goal: Connect Django to MSSQL server using FreeTDS. I'm using a Debian x64 box.</p>
  
  <p>Problem: When trying to make a connection I get the following.</p>
  
  <pre><code>('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'libtdsodbc.so' : file not found (0) (SQLDriverConnect)")
  </code></pre>
  
  <p>My <code>/etc/odbcinst.ini</code> is configured as followed</p>
  
  <pre><code>[FreeTDS]
  Description = FreeTDS
  driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
  setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
  </code></pre>
  
  <p>The files <strong>do</strong> exist and have 777 access for testing.</p>
  
  <p>The connection string is like</p>
  
  <pre><code>cnxn = pyodbc.connect(
          'DRIVER={FreeTDS};SERVER=' + server + ';PORT=1443;DATABASE=' + database + ';UID=' + username + ';PWD=' + password)
      cursor = cnxn.cursor()
  </code></pre>
  
  <p>My odbcinst -j reads (since adding symlink)</p>
  
  <pre><code>unixODBC 2.3.1
  DRIVERS............: /usr/local/etc/odbcinst.ini
  SYSTEM DATA SOURCES: /usr/local/etc/odbc.ini
  FILE DATA SOURCES..: /usr/local/etc/ODBCDataSources
  USER DATA SOURCES..: /root/.odbc.ini
  SQLULEN Size.......: 8
  SQLLEN Size........: 8
  SQLSETPOSIROW Size.: 8
  </code></pre>