Search code examples
pythonpython-3.xmacospyodbc

import pyodbc failure mac os


I've tried to install pyodbc on mac, but I got this error

Traceback (most recent call last):
  File "Untitled.py", line 1, in <module>
    import pyodbc
ImportError: dlopen(/usr/local/lib/python3.6/site-packages/pyodbc.cpython-36m-darwin.so, 2): Library not loaded: /usr/local/opt/unixodbc/lib/libodbc.2.dylib
  Referenced from: /usr/local/lib/python3.6/site-packages/pyodbc.cpython-36m-darwin.so
  Reason: image not found

What could it be and how can I solve it?


Solution

  • See if an installation of unixodbc helps you:

    brew install unixodbc