This topic describes how to install pure Python modules for general python scripting use in the core Data360 Analyze nodes, such as the Transform node and the Generate Data node.
Note: The following steps do not apply to NumPy or SciPy as these modules are not pure Python. Only pure Python modules can be installed, other third-party libraries are not supported.
Adding a pure Python module on Windows server
- Run Windows Command Prompt as an administrator.
- Set the environment variables to those appropriate for your Data360 Analyze installation:
<Data360AnalyzeInstallDirectory>\bin\laeEnv.bat
- Run the following command, replacing
<Data360AnalyzeSiteDirectory>
with the location of the site configuration directory and<module>
with the name of the Python module that you want to install:python -m pip install <module> --target <Data360AnalyzeSiteDirectory>\lib\jython2
For example:
python -m pip install httplib2 --target C:\Users\ExampleUser\Data360Analyze\site-7731\lib\jython2
- Change to the Data360 Analyze installation directory:
cd <Data360AnalyzeInstallDirectory>
- Set the environment variables to those appropriate for your Data360 Analyze installation:
source .profile.lavastorm
- Run the following command, replacing
<Data360AnalyzeSiteDirectory>
with the location of the site configuration directory and<module>
with the name of the Python module that you want to install:python -m pip install <module> --target <Data360AnalyzeSiteDirectory>/lib/jython2
Configure and run the Python-based node, for example the Generate Data or Transform node. The following example shows how to import the httplib2 module:
- In the ConfigureFields property, enter the following:
from httplib2 import Http out1.responseName = unicode out1.responseValue = unicode
- In the CreateRecords property, enter the following:
h = Http() resp, content = h.request("http://www.google.com") out1.responseName = 'status' out1.responseValue = resp['status'] node.write(0,out1) out1.responseName = 'content-type' out1.responseValue = resp['content-type'] node.write(0,out1)