title: PIP command to determine if the latest version is installed?
body: <p>Is there a <code>pip</code> command that will determine whether the latest version of a package is installed?</p>
  
  <p>I am writing a shell script that needs to determine if the latest version is installed. If not, then my script needs to manually install the package. (It's <a href="https://pypi.python.org/pypi/PIL" rel="nofollow noreferrer">PIL</a> if anyone's curious and needs to be installed manually because the headers and libraries for <code>libjpeg</code> are in a non-standard location.)</p>
  
  <p><a href="https://stackoverflow.com/a/10215100/193619">This answer</a> describes how to retrieve the version of the package currently installed, but I would also need the latest version available for download and some way to compare versions.</p>