This causes the package to be installed in $HOME/.local directory, where the $HOME is the home directory of the user you logged in. Please make sure that Xcalar runs as the same user. Typically the default user is "xcalar".

Please note that nltk also may requires nltk_data. The default location where nltk_data is installed using the program nltk.downloader is $HOME/nltk_data. The $HOME in this case is the home of the user which Xcalar is running as, the default being "xcalar".

/opt/xcalar/bin/python2.7 -m nltk.downloader all

If you have a large cluster, I will write a separate post of how you can do it automatically from Xcalar instead of from a unix shell. So please let me know.

But it seems to install pygame (when it previously did not exist). Upload the dummy UDF code in XD UDF window.

Modify the above UDF to:

import pygame
def foo(x):
return x

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.

This is an admin task. If you are not a Xcalar administrator, please speak with the admin in order to solve this problem. In case of python3.6, the process is outlined below. For instance, let's say you wanted to install the postgres package.

2) Now you can look for the file ${XCE_INSTALLDIR}/opt/xcalar/bin/pip3.6 as the correct version of pip3.6 that you can use to install any python packages.

3) Look for the definition of XCE_USER in ${XCE_INSTALLDIR}/etc/default/xcalar. If this is commented, the default xcalar user is "xcalar". If it is not commented, you will need to note down the user name. This is the user name that Xcalar processes will run as. Let's call this ${XCE_USER}. Now you will need to switch to this user.

4) su - ${XCE_USER}

5) Next step is to install the package as ${XCE_USER}.

${XCE_INSTALLDIR}/opt/xcalar/bin/pip3.6 install psycopg2 --user

In this case you will need to restart Xcalar. Certain python packages (especially those that have C dependencies) will require a xcalar restart.