0

I have a python script that processes excel files. I this script is run via python from the command line, it runs as expected but when I run from incron, it does't appear to see my imports, such as pandas

this is how I call from incron:

file/to/monitor IN_CREATE,IN_MOVED_TO /usr/bin/sh /my/main/shell/script

this is how my script looks like

#!/usr/bin/env python
source activate my_env
python /absolute/path/to/python/script

and now as I check on the logs, from abrt,

step1.1_executeConsolidation.py:2::ImportError: No module named pandas

I'm thinking this is just an environment issue with incron, but I'm not sure how to set it up properly.

I use anaconda by the way. If run manually, I don't have any library dependency issues

chip
  • 3,039
  • 5
  • 35
  • 59
  • I'd suggest `set -ex` at the top of your shell script, it'll likely help you find your error – anthony sottile Jul 31 '17 at 13:28
  • thanks another tool I can use :) I tried running my shell script that runs the python script, it works fine. now, I tried running the shell script from incron, now it doesn't work – chip Jul 31 '17 at 13:53
  • There should be more output that tells you what went wrong now, can you produce the entire output (and whatever log files `incron` provides)? – anthony sottile Jul 31 '17 at 14:40
  • for future readers. for now I have given up on incron, and will fallback to cron which works perfectly to how I want it to proceed. If I have more time, then I will dig deeper with incron. – chip Aug 01 '17 at 12:14

0 Answers0