Reputation: 345
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?
Upvotes: 19
Views: 14902
Reputation: 51
I tried all of the above with no luck. Finally I installed version 4.0.34 of pyodbc along with the unixodbc and now all is well.
brew install unixodbc
pip install pyodbc==4.0.34
Upvotes: 5
Reputation: 1
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Paste this command in MAC terminal if brew not found. after that - brew install unixodbc
Upvotes: 0