How to find assets of installed pip package
<p>While deploying my application, I need to install a library which contains some assets that must be served from an static directory. That means, during the deploy, I must do the following:</p>

<ol>
<li><code>pip install</code> the package</li>
<li>Find the <em>absolute</em> location where the package has been installed (this is usually <code>site-packages</code> in the virtualenv or global location)</li>
<li>Copy the assets from the installed package to the static directory</li>
</ol>

<p>Is there a portable way of doing step 2? The only starting piece of data that I have to find the installed package is <code>pip</code> / <code>python</code>.</p>

<p>Is there a way to tell <code>python</code>: in what absolute location have you installed a certain package?</p>

<p>You can try finding your installed package via the following command.</p>

<pre><code>pip show installed-package-name
</code></pre>

<p>This will return a bunch of attributes with package location. See below example.</p>

<pre><code>C:\&gt; pip show selenium
---
Metadata-Version: 2.0
Name: selenium
Version: 3.0.0b2
Summary: Python bindings for Selenium
Home-page: https://github.com/SeleniumHQ/selenium/
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Location: d:\appl\python27\lib\site-packages
Requires:
</code></pre>

python pip