title: Python: How do I find which pip package a library belongs to?
body: <p>I got a script transferred from someone else. And there is a module imported into the script. I'm wondering what is the best way to find out which pip package installed this library (<strong>other than search online</strong>).</p>
  
  <p>I tried to import the package and then just do help() on it but didn't got much information. Is there a reliable and pythonic way to achieve this?</p>
  
  <p>For example:</p>
  
  <p>In the script it has a line</p>
  
  <pre><code>from impala.dbapi import connect
  </code></pre>
  
  <p>Without searching on internet, how can I find out that following package can install this library? as you can see in this case the package name is is different from the name used in pip.</p>
  
  <pre><code>pip install impyla
  </code></pre>