I have a python script that uses the "requests" package. When I run the Universe program that calls the function I get the "requests" package not found. I then created another python script that calls the python script that contains the "requests" package and it works when I call that script from Universe. I must have something wrong in my path setting when coming from Universe and it cannot find the "requests" package. If I run the python script in Linux the program executes perfectly. If I invoke python from universe and import requests it works fine and finds the requests package. Both scripts are in the default location /XDEMO/PP.
u2.pth
/usr/ibm/bin
/usr/ibm/XDEMO/PP
Universe program:
SUBROUTINE SUB.BASEVEHICLE(VEHID,VEHOUT)
CMD = "REINIT.PYTHON OFF"
EXECUTE CMD
ModuleName = "callbaseveh"
FuncName = "getbasevehinf"
RESULT = PyCallFunction(ModuleName , FuncName, VEHID)
IF @PYEXCEPTIONTYPE NE '' THEN
CRT "EXCEPTION TYPE IS " :@PYEXCEPTIONTYPE
CRT "EXCEPTION MESSAGE IS " :@PYEXCEPTIONMSG
CRT "EXCEPTIONTRACEBACK IS " :@PYEXCEPTIONTRACEBACK
END
VEHOUT = RESULT
RETURN
PYTHON CODE