title: Checking if a package is installed specifically via pip
body: <p>Checking if a particular package is available from within Python can be done via</p>
  
  
  
  <pre><code>try:
      import requests
  except ImportError:
      available = False
  else: 
      available = True
  </code></pre>
  
  <p>Additionally, I would like to know if the respective package has been <strong>installed with <code>pip</code></strong> (and can hence been updated with <code>pip install -U package_name</code>).</p>
  
  <p>Any hints?</p>