title: Installing pyodbc and unixodbc on a mac
body: <p>I've seen <a href="https://stackoverflow.com/questions/28566121/pypyodbc-cant-open-lib-freetds-file-not-found-error-when-trying-to-conne">Pypyodbc: Can&#39;t open lib &#39;FreeTDS&#39; : file not found&quot;) error when trying to connect to SQL server</a>, but. that's 7 years old, and doesn't seem to be working for me, possibly because brew appears to be putting things in different places now?</p>
  <p>I've used brew to install unixodbc, it's in <code>/opt/homebrew/Cellar</code>.</p>
  <p>When I do pip install pyodbc, it appears to work, but I get:</p>
  <pre><code> connection = pyodbc.connect(connection_string)
  pyodbc.Error: ('01000', &quot;[01000] [unixODBC][Driver Manager]Can't open lib '/usr/local/lib/libtdsodbc.so' : file not found (0) (SQLDriverConnect)&quot;)
  </code></pre>
  <p>which is obviously wrong, because libtdsodbc is in <code>/opt/homebrew/lib</code></p>
  <p>I tried editing <code>odbcinst.ini</code>, but I'm not sure where that's supposed to live. There wasn't one in /etc, or a /etc/unixODBC directory... and when I create either one, the don't seem to be read, because it still complains about /usr/local/lib...</p>
  <p>ETA: This is on a new Macbook, so on one of the new M1 chips.</p>