mkleehammer / pyodbc

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

proper way to detect unixODBC #1097

Closed dcsaba89 closed 1 year ago

dcsaba89 commented 1 year 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

https://github.com/mkleehammer/pyodbc/blob/master/setup.py#L240

in setup.py line 240 after the comment What is the proper way to detect iODBC, MyODBC, unixODBC, etc.? it should be settings['libraries'].append(':libodbc.so.2')

v-makouz commented 1 year ago

The standard way is to run odbcinst -j although if you have several unixODBC installations it may be inaccurate. In that case the ultimate way is to do an strace and see which lib is actually loaded.