In this blog we will see how to solve python module error while creaing Splunk add-on using Splunk Add-on builder.
NumPy and panda’s Module
The Pandas module mainly works with the tabular data, whereas the NumPy module works with the numerical data. The Pandas provides some sets of powerful tools like DataFrame and Series that mainly used for analyzing the data, whereas in NumPy module offers a powerful object called Array.
- First we have to add all python modules which are required in the below-given directory $SPLUNK_HOME/etc/apps/<app>/bin/.
- In python code, we have dependencies of NumPy and panda’s Modules. so we have to copy this module to the app/bin folder, and we faced error module not found while creating add-on.
We can face the errors below:
Steps to solve python module errors
- We are facing this error due to the incompatibility of the NumPy version and the python.
- Remove the python module from your app/bin.
- Now install the module using
- /opt/splunk/bin/python3 -m pip install numpy
- pip will download the compatible version of NumPy for Splunk
- To verify package installation and NumPy version run the below command.
/opt/splunk/bin/python3 -m pip show numpy
- Now go to the folder where packages are
- Copy all the installed packages and paste them to your app/bin
- After copying you can see the module error is resolved