{"id":24693,"library":"teradata","title":"Teradata Python Driver (PyTd)","description":"The official Teradata Python driver (PyTd) for executing SQL against Teradata UDA (Unified Data Architecture). Version 15.10.0.21 supports Teradata Database 15.10+. The library is in maintenance mode; newer applications should consider using the `teradatasql` driver. Release cadence is intermittent.","status":"maintenance","version":"15.10.0.21","language":"python","source_language":"en","source_url":"http://github.com/teradata/PyTd","tags":["teradata","database","sql","odbc","maintenance"],"install":[{"cmd":"pip install teradata","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"udaExec is a module attribute, not a direct import; use 'import teradata' then 'teradata.UdaExec'","wrong":"from teradata import udaExec","symbol":"udaExec","correct":"import teradata"},{"note":"'UdaExec' is inside the teradata package; direct import does not work.","wrong":"import UdaExec","symbol":"teradata.UdaExec","correct":"udaExec = teradata.UdaExec(appName='test')"}],"quickstart":{"code":"import teradata\n\nudaExec = teradata.UdaExec(appName='test', version='1.0', logConsole=False)\nsession = udaExec.connect(method='odbc', system='your_td_host', username=os.environ.get('TD_USER', ''), password=os.environ.get('TD_PASS', ''))\n\nquery = \"SELECT DATABASENAME FROM DBC.DATABASESV WHERE DATABASENAME = 'DBC'\"\ndf = session.execute(query).fetchall()\nprint(df)\nsession.close()","lang":"python","description":"Connect using ODBC and run a simple query."},"warnings":[{"fix":"Install Teradata ODBC driver (Windows) or use method='rest' with REST endpoints (if available).","message":"Default ODBC DSN not configured: The driver requires either a DSN or method='odbc' with system/user/pass. Using method='odbc' without a DSN is common but misconfigured if no Teradata ODBC driver is installed.","severity":"gotcha","affected_versions":"all"},{"fix":"Migrate to `pip install teradatasql` and update connection syntax.","message":"Library in maintenance: Teradata recommends using `teradatasql` for new projects. `teradata` (PyTd) is no longer actively developed.","severity":"deprecated","affected_versions":">=15.0"},{"fix":"Always iterate or call `.fetchall()` and ensure result set is consumed or closed.","message":"Connection leaks: `execute()` returns a result set that must be closed or fetched entirely; otherwise, subsequent queries may hang.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'15.10':25 '15.10.0.21':21 'applic':33 'architectur':19 'cadenc':41 'consid':35 'data':18 'databas':24,45 'driver':3,9,39 'execut':12 'intermitt':43 'librari':27 'mainten':30,48 'mode':31 'newer':32 'odbc':47 'offici':6 'pytd':4,10 'python':2,8 'releas':40 'sql':13,46 'support':22 'teradata':1,7,15,23,44 'teradatasql':38 'uda':16 'unifi':17 'use':36 'version':20","created_at":"2026-05-01T08:14:25.978365+00:00","updated_at":"2026-05-01T08:14:25.978365+00:00","problems":[{"fix":"Use `session.execute(query, fetch_size=1000)` to limit fetch size.","cause":"Result set too large for ODBC driver buffer; default fetch size is unlimited.","error":"Error: ('HY000', '[HY000] [Teradata][ODBC Teradata Driver] Not enough memory')"},{"fix":"Grant necessary permissions via Teradata DBA.","cause":"User lacks required privileges (e.g., creating tables, macros).","error":"teradata.api.DatabaseError: (3707, '[Teradata Database] [3932] The user is not a privileged user.')"},{"fix":"Use `import teradata` and reference `teradata.UdaExec`.","cause":"Incorrect import; user tried `from teradata import UdaExec`.","error":"AttributeError: module 'teradata' has no attribute 'UdaExec'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"15.10.0.21","cli_name":"","cli_version":null,"type":"library","homepage":"https://teradata.com","github":"http://github.com/teradata/PyTd","docs":null,"changelog":null,"pypi":"https://pypi.org/project/teradata/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}