This article discusses what to do when it is not possible to import modules correctly while running Python within a Pig script.
When running a Python within a Pig script, the following error was seen:
ImportError: No module named jsonJython is being used with version 2.5.3 and does not contain the same number of modules as standard Python distributions.
Review the Pig script and confirm that Jython is being used. For example, this line runs the Python script utils.py via Jython:
REGISTER './utils.py' using jython as utils;Review Jython documentation to add the required module into Jython.