This should/might work in 4.0.23, as it was the way it was done up to pyodbc v3.0.7:
First, in the file setup.py
, change line 165 from --
settings['libraries'].append('odbc')
-- to --
settings['libraries'].append('iodbc')
Second, disable/delete lines 178, 179, and 183.
# Add directories for MacPorts and Homebrew.
# dirs = ['/usr/local/include', '/opt/local/include','~/homebrew/include']
# settings['include_dirs'].extend(dir for dir in dirs if isdir(dir))
# unixODBC make/install places libodbc.dylib in /usr/local/lib/ by default
# ( also OS/X since El Capitan prevents /usr/lib from being accessed )
# settings['library_dirs'] = [ '/usr/local/lib' ]
For reference, see the file setup.py
as of pyodbc 3.0.7, starting at line 146
Note: This will use the macos system supplied -- and presumably outdated -- libiodbc.dylib
in /usr/lib
. Not sure where the iODBC Framework installs the iODBC files, though. Maybe TallTed can comment on this?