I have a python script that pulls data from an SFTP source and writes the data to a file (myScript.py). The script imports two modules that I installed. As such, I wrote a bash wrapper script to call my script and run it with standard python (myScriptLauncher.sh).
I can run the bash script from the command line fine. However, when I try to run it using Splunk (./splunk cmd /opt/splunk/etc/apps/myApp/bin/myScriptLauncher.sh), I get a module import error.
I'm not sure what I am doing wrong. Anyone have any suggestions?
error
Traceback (most recent call last):
File "./myScript.py", line 4, in <module>
import pysftp
ImportError: No module named pysftp
myScript.py
#!/usr/bin/env python
import json
import pysftp
import openpyxl
REST OF CODE GOES HERE
myScriptLauncher.sh
#!/bin/bash
echo myScript is starting >&2
cd $( dirname "${BASH_SOURCE[0]}" )
exec /usr/bin/python ./myScript.py
... View more