Open ausiddiqui opened 6 years ago
PyTd is expecting to load the ODBC Driver Manager library not the Teradata ODBC Driver library. Looks like you are providing the Teradata OBDC Driver path for odbcLibPath which does not implement the SQLDrivers function.
What is the error you get when you don't specify the odbcLibPath and what do the logs show? Here is what my logs show with it working:
2017-12-18 17:34:37,810 - teradata.tdodbc - INFO - Loading ODBC Library: libiodbc.dylib
2017-12-18 17:34:37,822 - teradata.tdodbc - INFO - Available drivers: Teradata, Teradata Database ODBC Driver 16.10, Teradata Database ODBC Driver 16.20
2017-12-18 17:34:37,823 - teradata.tdodbc - WARNING - More than one driver found for 'Teradata'. Using 'Teradata Database ODBC Driver 16.20'. Specify the 'driver' option to select a specific driver.
Hey thanks for answering so quickly. Even if I were to run
from teradata import tdodbc
conn = tdodbc.connect()
I get the same exact error. Not sure what other odbc driver I could install? iODBC?
Stupid question, but how do I find the logs for these commands? Can you suggest any other changes to my .ini files and ENV variables, are they pointing to haphazard or wrong things?
You typically shouldn't access the tdodbc submodule directly but instead should use the UdaExec wrapper that sets up the logging context. Logs will print directly to console by default and to a file in a logs directory local to the working directory.
E.g.
import teradata
udaexec = teradata.UdaExec("Hello World!", "1.0")
session = udaexec.connect(method="odbc", system="td_host_name", username="myuser", password="mypass")
for row in session.execute(file="NDARDS_CLOB_USAGE.txt", delimiter=";;"):
print(row)
iODBC use to be installed by default on OS X but maybe that has changed. Definitely recommend using iODBC Driver Manager.
The Teradata ODBC driver 16.20 documentation states:
Teradata ODBC driver is supported with iODBC driver manager (version 3.52.8) that is installed by default on Apple OS X. The Teradata Tools and Utilities install suite will not install ODBC Driver Manager along with ODBC Driver for Teradata.
OS: macOS 10.13.2 Python: 2.7.14 Teradata ODBC Driver for Mac OS X: 16.20.00.0006 unixodbc: Not installed
I am able to test a successful connection using the following operations on command line:
However, when I try to use the Python functionality I get nowhere. Even without any arguments into
tdodbc.connect()
it is the same error.Environment Variables set in ~.zshrc (same as ~.bash_profile)
ODBC.ini Location: ~/Library/ODBC/odbc.ini
ODBCINST.ini Location: ~/Library/ODBC/odbcinst.ini
ODBC.ini file in Teradata Directory: Location:/Library/Application Support/teradata/client/16.20/odbc/odbc.ini
ODBCINST.ini file in Teradata Directory: Location:/Library/Application Support/teradata/client/16.20/odbc/odbcinst.ini
ODBCINST.ini file in the generic Teradata Directory: Location: /Library/Application Support/teradadata/client/ODBC/odbcinst.ini