mkleehammer / pyodbc

Python ODBC bridge
https://github.com/mkleehammer/pyodbc/wiki
MIT No Attribution
2.89k stars 562 forks source link

/usr/local/lib/libtdsodbc.so Not Exists! #1052

Closed TianruiZhang closed 2 years ago

TianruiZhang commented 2 years ago

Please first make sure you have looked at:

Environment

To diagnose, we usually need to know the following, including version numbers. On Windows, be sure to specify 32-bit Python or 64-bit:

Issue

I followed your instruction all along until odbcinst.ini and odbc.ini. tsql -S MYMSSQL -U myuser -P mypassword runs successfully . I guess the problem lies here:

[FreeTDS]
Description=FreeTDS Driver for Linux & MSSQL
Driver=/usr/local/lib/libtdsodbc.so
Setup=/usr/local/lib/libtdsodbc.so
UsageCount=1

In fact, I couldn't /usr/local/lib/libtdsodbc.so anywhere. By the way, I am using docker on my m1 MacBook Pro.

v-chojas commented 2 years ago

Make sure you install an ODBC driver first?

TianruiZhang commented 2 years ago

Yes, I installed both of them with brew install unixodbc freetds

v-chojas commented 2 years ago

You say you are using Docker. Did you install that on the host, or inside the container?

TianruiZhang commented 2 years ago

I installed that on my local machine and I think you have pointed out the problem. I'll try to connect to a remote db server from my m1 to see if there's any problem.