title: ModuleNotFoundError when executing Python program from bash script
body: <p>I have a script which monitors a directory using <code>inotify-tools</code>. When a new file is added to the directory, the script calls a python program and passes the path and fill name as arguments.</p>
  
  <p>It all works fine, except that I get a <code>ModuleNotFoundError</code>... the module in question is boto3 (for AWS S3). </p>
  
  <p>The python script works fine in Pycharms, so I really do not know what is causing the error.</p>
  
  <p>Monitor script:</p>
  
  <pre><code>source=$1
  pythonscriptlocation=$2
  
  inotifywait -m $source -e create -e moved_to |
  while read path action file; do
      python $pythonscriptlocation $path $file
  done
  </code></pre>
  
  <p>Python script example:</p>
  
  <pre><code>import argparse
  import boto3
  
  parser = argparse.ArgumentParser();
  parser.add_argument("source_path");
  parser.add_argument("filename");
  args = parser.parse_args();
  print(args.source_path);
  print(args.filename);
  </code></pre>
  
  <p><strong>Update - Solution</strong></p>
  
  <p>It turned out that <code>ANACONDA</code> had added an environment variable to the bottom of my <code>.bashrc</code> file... as a result, it screwed up my <code>PATH</code>. Deleted the line and then 1 more problem: in the monitor script, I was calling <code>python</code>, but should have been calling <code>python3</code>.</p>