Closed tombola closed 1 year ago
The relevant code in pypyodbc
https://github.com/pypyodbc/pypyodbc/blob/main/pypyodbc.py#L419-L484
I retrospect i wonder if the find_library()
issue* might be symptomatic of a similar issue when I tried again to get pyodbc to run against filemaker, as that also returned an SQL Error
when the library was not found.
* On mac the function just returns some expected paths, which are not accurate if installed using homebrew.
I got
pypyodbc
to useiodbc
(rather thanunixodbc
) on mac by supplying this pull request - https://github.com/pypyodbc/pypyodbc/issues/26This just allows
pypyodbc
to findlibiodbc.dylib
whenlibiodbc
has been installed by homebrew.It still only looks for iodbc if unixodbc is not present, otherwise that gets loaded instead.
At the time of writing this is still not present in a release of pypyodbc, so I am installing via git.
So, currently for
pypyodbc
to work for me on MacOs, the following should evaluate toNone
python -c "from ctypes.util import find_library; print(find_library('odbc'))"
Otherwise
pypyodbc
tries to loadunixodbc
(and from incorrect path). To avoid this:brew uninstall --ignore-dependencies unixodbc && brew install libiodbc