Execution for Geo processing tool using custom python packages

We have Geo processing tool to be executed in ArcGIS Server Linux.Tool execution failed due to import python module(seabird) in ArcGIS Server.We have written Python code using custom python packages(pip,seabird) in windows platform and published to ArcGIS Server as a Geo processing Service.

We have upgraded existing python version 2.6.6 to 2.7.10 in Linux server and installed both pip and seabird.But tool execution failed in ArcGIS Server.Please help us to provide solution for tool execution in Linux server using custom python packages.

We observed one different issue after tool published and executed on server.

Tool executed successfully for the first time.If we want to re-execute the tool, execution failed with below error message(collected from ArcGIS Server Logs)

We are using ArcGIS 10.3.1 Server, Python 2.7 and third party python packages PIP - 8.1.2 and Seabird-0.8.1 on RHEL Server 6.5. Both the third party python packages are installed on RHEL server.Please help us to resolve this issue.

I'd say you can focus on the line mod = sys.modules[extant]. It says NoneType object has no attribute "modules" indicating that when you import sys, a NoneType object, ("None"), is returned. An easy way to test this is by running the python included with Server, importing sys, seeing what type of object it is, and then seeing what sys.modules gives you: