Here is a more advanced method for installing python packages in case you want to do this automatically from Xcalar Design, our GUI.
Let's say the user wants to install the python module "pygame". By default Xcalar does not package this. So:
Error: ['Traceback (most recent call last):\n', ' File "xcalar_udf_8ca4e3289fc7ed94", line 1, in \n', 'ImportError: No module named pygame\n']
This is expected. So we fix this using a dummy Map UDF:
os.system("/opt/xcalar/bin/pip2.7 install --user pygame")
But it seems to install pygame (when it previously did not exist). Upload the dummy UDF code in XD UDF window.
Restart Xcalar. Modify the above UDF to:
Upload this UDF, and you should not get an import error. Note that pygame is not being used, but the import statement should succeed this time. This is an indication that you have successfully imported a new python module. Note that all your python modules will be installed in $HOME/.local directory, the home of the user, Xcalar is running as.