I successfully installed pyodbc module for python 2.7. However, when input the following code to connect to teradata,
import pyodbc
conn = pyodbc.connect(\'DRIVER
Basically pyodbc is not straight forward and gives good enough debugging time for developers. Follow the below steps,
You might have done them already, then just verify
Install iodbc for mac http://www.iodbc.org/dataspace/iodbc/wiki/iODBC/Downloads
Install Teradata ODBC Driver for Mac OS X, http://downloads.teradata.com/download/connectivity/teradata-odbc-driver-for-mac-os-x
Also install unixodbc for mac, “brew install unixodbc”
Download pyodbc source and change the setup.py file as below,
elif sys.platform == 'darwin': # OS/X now ships with iODBC. settings['libraries'].append('iodbc') settings['libraries'].append('odbc')
you will be adding the last line of including “odbc” for build Build and install pyodbc
export DYLD_LIBRARY_PATH=/Library/Application\ Support/teradata/client/ODBC/lib:/Library/Application\ Support/teradata/client/15.00/lib/
export ODBCINI=/Library/Application\ Support/teradata/client/15.00/odbc/odbc.ini
Now pyodbc cursor happily will fetch record sets for you