Teradata SQL Driver for Python

Connectivity
Connectivity covers the mechanisms for connecting to the Teradata Database, including driver connectivity via JDBC or ODBC.
Highlighted
Teradata Employee

Teradata SQL Driver for Python

Hi all,

I starting with teradatasql for load some data in Teradata using python, but using the connect class , I have errors that I don't understand, does somebody have any ideas to fix my error ?

 

import teradatasql
>>> con=teradatasql.connect ('{"host":"192.168.79.129","user":"dbc","password":"dbc"}')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\rb255002\AppData\Local\Programs\Python\Python36-32\lib\site-packages\teradatasql\__init__.py", line 92, in __init__
goside = ctypes.cdll.LoadLibrary(sLibPathName)
File "C:\Users\rb255002\AppData\Local\Programs\Python\Python36-32\lib\ctypes\__init__.py", line 426, in LoadLibrary
return self._dlltype(name)
File "C:\Users\rb255002\AppData\Local\Programs\Python\Python36-32\lib\ctypes\__init__.py", line 348, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application


Accepted Solutions
Teradata Employee

Re: Teradata SQL Driver for Python

Are you running 32-bit Python? The teradatasql package is 64-bit only (and considered to be "pre-Alpha").

Consider using the prior "teradata" package which supports both 32-bit and 64-bit Python.

 

1 ACCEPTED SOLUTION
3 REPLIES
Teradata Employee

Re: Teradata SQL Driver for Python

Are you running 32-bit Python? The teradatasql package is 64-bit only (and considered to be "pre-Alpha").

Consider using the prior "teradata" package which supports both 32-bit and 64-bit Python.

 

Teradata Employee

Re: Teradata SQL Driver for Python

Hi,

 

I had to develop some stuff with python recently, and I've been using SQL Alchemy with Teradata dialect which requires Teradata package if I remember correctly.

Not sure about the 32 / 64 bits requirements though.

Teradata Employee

Re: Teradata SQL Driver for Python

Fred is correct. That error message occurs if you attempt to use the Teradata SQL Driver for Python with 32-bit Python. Please use 64-bit Python instead.

 

We do offer a SQLAlchemy dialect for the Teradata SQL Driver for Python https://pypi.org/project/teradatasqlalchemy/

 

You can install the dialect with pip install teradatasqlalchemy