PyTd icon indicating copy to clipboard operation
PyTd copied to clipboard

Issues on Ubuntu (works well on CentOS)

Open dclong opened this issue 8 years ago • 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?

dclong avatar May 07 '17 09:05 dclong

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 avatar May 07 '17 14:05 escheie

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

dclong avatar May 08 '17 00:05 dclong

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

dclong avatar May 08 '17 02:05 dclong

@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

dclong avatar May 08 '17 03:05 dclong

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 avatar May 08 '17 16:05 escheie

@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

dclong avatar May 09 '17 16:05 dclong

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.

escheie avatar May 09 '17 16:05 escheie

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

dclong avatar May 10 '17 01:05 dclong

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

dclong avatar Nov 16 '17 23:11 dclong