title: Bash script to run python script in python environment runs on ubuntu command line but not in crontab
body: <p>I have this crontab to run the bash script predictions.sh at a certain time every day. The script does not run in the crontab, but it runs on the ubuntu command line. I am using AWS Ubuntu 16.04.5.</p>
  
  <pre><code>#!/bin/sh -x
  SHELL=/bin/bash
  PATH=~/bin:~/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/bin
  LANG=en_US.UTF-8
  51 14 * * * ./predictions.sh
  
  </code></pre>
  
  <p>The bash script itself runs a python file after activating a python environment 'dateprep':</p>
  
  <pre><code>source dataprep/bin/activate
  cd dataprep
  python datafiles.py
  
  </code></pre>
  
  <p>Would any one know how to get the crontab to work? Thank you</p>