Teradata/PyTd

Issues on Ubuntu (works well on CentOS)

Opened this issue · 9 comments

I got the following error using the package on Ubuntu (with Teradata ODBC 16.00 driver installed).

DatabaseError: (0, '[I] [. Check that the ODBC driver is installed and the ODBCINI or ODBCINST environment variables are correctly set.')
  1. I have ODBCINI exported.
  2. pyodbc works well on the same Ubuntu machine.
  3. The Python code and Teradata ODBC configuration works well on a CentOS machine (with Teradata ODBC 16.00 driver installed).

This makes me wondering: does the Teradata package rely on some CentOS specific features (folder structure, configuration file, etc.) to work?

The Teradata Python module loads the "libodbc.so" library without specifying a path. When the Teradata ODBC Driver is installed it copies the Data Direct Driver Manager it ships with to the system path where the Teradata Python module typically finds it. If another driver manager is installed however, such as unixodbc, this may cause the Teradata Python Module to load the wrong Driver Manager, resulting in the error above. You should be able to get past this error by specifying the odbcLibPath option either when initializing UdaExec or in the CONFIG section of your external configuration file with the location of the correct libodbc.so file to load.

@escheie
Thank you! I'll have a try to see whether this works on Ubuntu.

@escheie
Specifying the odbcLibPath option works for me on Ubuntu! Thank you very much for your help!

@escheie
Sorry that I closed the issue too early. The problem hasn't been resolved actually. I didn't realize that I was working in my CentOS docker container.

After specifying the odbcLibPath, I got the following error message. libddicu27.so is in the same directory as libodbc.so.

OSError: libddicu27.so: cannot open shared object file: No such file or directory

I checked files in my CentOS docker container, I don't see the *.so files get copied to a system path. libodbc.so are found at the 2 locations in both my CentOS and Ubuntu docker container.

/opt/teradata/client/16.00/lib64/libodbc.so
/opt/teradata/client/16.00/lib/libodbc.so

Try setting the LD_LIBRARY_PATH environment variable to the location where the Teradata ODBC libraries can be loaded. E.g.

export LD_LIBRARY_PATH=/opt/teradata/client/ODBC_64/lib

@escheie
This doesn't work for me. The same error msg shows up.

OSError: libddicu27.so: cannot open shared object file: No such file or directory

Where is libddicu27.so located on your system? You may have to modify the LD_LIBRARY_PATH above to make sure it includes that library.

It's in the same directory as libodbc.so. I've tried different options for LD_LIBRARY_PATH but unfortunately none of them worked.

I seriously think Teradata should prepare a deb for its ODBC driver.