Teradata Python Module

Tools
Tools covers the tools and utilities you use to work with Teradata and its supporting ecosystem. You'll find information on everything from the Teradata Eclipse plug-in to load/extract tools.
Enthusiast

Re: Teradata Python Module

@Roopalini 

I have found that for linux, you will need to have a version of pip for each version of python (in my case it was 2.7).

To have RHEL use 2.7 by default instead of 2.6:

Create /etc/profile.d/enablepython27.sh

In the file:

#!/bin/bash

source scl_source enable python27

From <https://access.redhat.com/solutions/527703>

Open up permissions to allow it to apply to all users

 

To install an alternate version of pip:

curl -O https://bootstrap.pypa.io/get-pip.py

python get-pip.py

Then you can install the teradata module:

pip2.7 install teradata

Enthusiast

Re: Teradata Python Module

@Roopalini

sorry, i neglected to mention that in order to get the above to work, I needed to add the software collection repo:

To install python 2.7:

Add the software collection repo:

wget -qO- http://people.redhat.com/bkabrda/scl_python27.repo >> /etc/yum.repos.d/scl.repo

For some reason I would sometimes need to clean out the repo list after this to get installs to work:

mkdir /etc/yum.repos.d/repo.disabled

yum clean all

yum install python27

Enthusiast

Re: Teradata Python Module

Thanks for the response. I actually have my default python set to python3.4. My only issue is that the Teradata module is not taking the python3.4 version.

[root@ttudev ]# python

Python 3.4.3 (default, Sep 22 2015, 12:23:35)

[GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux

Type "help", "copyright", "credits" or "license" for more information.

>>>

I am getting the below error when I try to install the alternate version of PIP.

[root@ttudev]# curl -O https://bootstrap.pypa.io/get-pip.py

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100 1379k  100 1379k    0     0   773k      0  0:00:01  0:00:01 --:--:--  874k

[root@ttudev]# python get-pip.py

Traceback (most recent call last):

  File "get-pip.py", line 17759, in <module>

    main()

  File "get-pip.py", line 162, in main

    bootstrap(tmpdir=tmpdir)

  File "get-pip.py", line 82, in bootstrap

    import pip

zipimport.ZipImportError: can't decompress data; zlib not available

Not sure why it says zlib not available. I see the rpm is already there.

[root@ttudev]# rpm -qa |grep zlib

zlib-1.2.3-29.el6.x86_64

Enthusiast

Re: Teradata Python Module

yea thats likely because pip2.6 is running the install. Can you check to see if pip3.4 exists already?

Enthusiast

Re: Teradata Python Module

pip3.4 does not seem to be there. This is what I see in /usr/bin

[root@ttudev bin]# cd ../../bin

[root@ttudev bin]# ls -ltr pip*

-rwxr-xr-x 1 root root 204 Sep 23 09:05 pip

-rwxr-xr-x 1 root root 204 Sep 23 09:05 pip2.6

-rwxr-xr-x 1 root root 204 Sep 23 09:05 pip2

I think the issue will get resolved , if I install pip3.4 successfully.

Enthusiast

Re: Teradata Python Module

Any help here please?

Teradata Employee

Re: Teradata Python Module

Python3.4 is suppose to include setuptools and pip so not sure why those modules cannot be found.  Can you try executing the following command?

python3.4 -m ensurepip

Teradata Employee

Re: Teradata Python Module

Hi

I am calling a stored procedure which has a big var chars , and I am getting the following error

teradata.api.DatabaseError: (9804, '[HY000] [Teradata][ODBC Teradata Driver][Teradata Database] Response Row size or Constant Row size overflow. ')

I have tested with sql assistant + odbc connection and I do not get any error.

Procedure definition is

Format:HTML Format Version:1.0 StartHTML: 165 EndHTML: 708 StartFragment: 314 EndFragment: 676 StartSelection: 314 EndSelection: 314


REPLACE PROCEDURE DWX10P_FF.GCFR_FF_TPTExport_Generate


        (
IN iProcess_Name VARCHAR(30)
,
IN iDebug_Level BYTEINT
,
IN iProcess_Type BYTEINT
,
IN iProcess_State BYTEINT
,
IN iTD_Server VARCHAR(30)
,
IN iTD_User_Name VARCHAR(30)
,
IN iPassword_String VARCHAR(30)
,
OUT oReturn_Code SMALLINT
,
OUT oReturn_Message VARCHAR(256)
,
OUT oReturn_Parameters VARCHAR(300)
,
OUT oReturn_Script VARCHAR(31000) -- used for returning generated TPT script
,OUT oReturn_LogonText VARCHAR(100)
)
MAIN:

my call is

 result = session.callproc("${GCFR_FF}.GCFR_FF_TPTExport_Generate"

  ,(iProcess_Name,iDebug_Level,iProcess_Type,iProcess_State,iTD_Server,iTD_User_Name,iPassword_String

  ,teradata.OutParam("oReturn_Code",dataType="INTEGER"),teradata.OutParam("oReturn_Message")

  ,teradata.OutParam("oReturn_Parameters"),teradata.OutParam("oReturn_Script"),teradata.OutParam("oReturn_LogonText")))

Teradata Employee

Re: Teradata Python Module

@cw171001 -  I created an SP with the same signature that returns output parameters with the maximum number of characters but I am unable to reproduce the error you are hitting.    Could you try upgrading the Teradata Python Module if you're not already using the latest version?  Is the same environment (e.g. Database and ODBC version), the same session attributes (e.g. user, transaction mode, charset, etc.), and the same SP arguments being used when comparing SQL Assistant vs. Python?

Enthusiast

Re: Teradata Python Module

Hello

i have windows 7, and python notebook of anaconda,

i did pip install teradata, is ok

i run;

import teradata

udaExec = teradata.UdaExec (appName="HelloWorld", version=("1.0",logconsole=False)

try:

  session = UdaExec.connect(method="odbc", system="TERADATA", username="XXX", password="XXX");

and the problem is

DatabseError: (100065, u"[08001][WSock32 DLL] 19965 WDA E HostUnreach: The Teradata server can´t currently be reached over this network")

please help