New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ODBC Library(libodbc.so) loading issue in AIX 7.1 #95
Comments
Hi Frank, I have not tested PyTd on AIX. You can set odbcLibPath without a code change by passing it as an argument to UdaExec or by specifying it in an external config file. I think we would only add the default value for AIX if it was officially tested on that platform. I will keep this issue open to track interest in officially certifying on AIX. Thanks, |
Hi Eric, Did not know that we can specify "odbcLibPath" in external config file. Thanks for your help. Regards, |
Hi Frank and Eric, Glad to find this discussion, as I've also struggled to connect to Python to Teradata from AIX 7.1. Defining the odbcLibPath was critical, but I found it only works when placed in the udaexec.ini and NOT when passed as a UdaExec parameter. I also found (in another post) that I had to define Authentication=LDAP. Strangely, this only works as a UdaExec parameter but NOT in the udaexec.ini (converse to the odbcLibPath)! Beyond the finicky location, this confuses me for other reasons... first, because the Teradata Python Module documentation doesn't include Authentication among UdaExec's valid parms, but also because I had already declared "Authentication=LDAP" in the odbc.ini config, within my DSN section. Why doesn't it work there? Here is my sample Python program (which works): My udaexec.ini file: [DEFAULT] And finally, my /opt/teradata/client/ODBC_64/odbc.ini file: [ODBC Data Sources] [tdt] Optimally, I want to place as much config as possible in external files to keep our programs cleaner, so I'd like to move the "method" and "authentication" to external configs, but attempting to do so breaks the db connection. Any insight you can offer is appreciated. Thanks, |
Hi @djb18 I never use ODBC DSN as 'system', I always put all parameters into a external config file. Frank |
Hi Guys, I am stuck on the same issue here - I tried to pass an alternative value of odbcLibPath, but in both cases (in config, and passing as a param), I get the same error: using: File "/opt/freeware/lib64/python3.5/teradata/udaexec.py", line 183, in connect **args)) Any assistance gratefully received. |
Env: OS AIX 7.1.0.0
tdodbc version: 14.10.0.7
xxxxxxxxxx:/opt/teradata/client/ODBC_64/lib: lslpp -l | grep odbc
tdodbc1410.tdodbc1410 14.10.0.7 COMMITTED Teradata ODBC Driver for AIX
Tried to use PyTD to connect Teradata in AIX 7.1 but got following error:
Traceback (most recent call last):
File "/opt/freeware/lib64/python3.5/runpy.py", line 184, in _run_module_as_main
"main", mod_spec)
File "/opt/freeware/lib64/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/xxxxxx/python/proj/cba/aipl/proj_teradata.py", line 71, in
with ConnTest() as myConnTest:
File "/home/xxxxxx/python/proj/cba/aipl/teradata/proj/init.py", line 1747, in init
self.session = get_db_conn(config_files, query_band)
File "/home/xxxxxx/python/proj/cba/aipl/teradata/utils/tdconn.py", line 166, in get_db_conn
session = uda_exec.connect(queryBands=query_band, dataTypeConverter=TeradataDataTypeConverter(), **conn_param)
File "/home/xxxxxx/python/proj/lib64/python3.5/site-packages/teradata/udaexec.py", line 183, in connect
**args))
File "/home/xxxxxx/python/proj/lib64/python3.5/site-packages/teradata/tdodbc.py", line 399, in init
init(odbcLibPath)
File "/home/xxxxxx/python/proj/lib64/python3.5/site-packages/teradata/tdodbc.py", line 344, in init
initOdbcLibrary(odbcLibPath)
File "/home/xxxxxx/python/proj/lib64/python3.5/site-packages/teradata/tdodbc.py", line 297, in initOdbcLibrary
odbc = ctypes.cdll.LoadLibrary(odbcLibPath)
File "/opt/freeware/lib64/python3.5/ctypes/init.py", line 435, in LoadLibrary
return self._dlltype(name)
File "/opt/freeware/lib64/python3.5/ctypes/init.py", line 357, in init
self._handle = _dlopen(self._name, mode)
OSError: 0509-022 Cannot load module .
0509-026 System error: A file or directory in the path name does not exist.
Did a little bit further investigation, then found there was an issue to load libodbc.so
It turned out there is no file named libodbc.so, but there is one file named "odbc.so" exist in /opt/teradata/client/ODBC_64/lib
So, I manually changed the code of function: initOdbcLibrary in tdodbc.py and added hack for AIX, now it is working fine.
workaround codes:
Should this workaround to be added in?
Do we have testing in AIX flatform?
Thanks,
Frank
The text was updated successfully, but these errors were encountered: