Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>A common approach is ship a <a href="http://www.pip-installer.org/en/latest/requirements.html" rel="nofollow">requirements file</a> with a project, specifying which version of which library is required. This file is (by convention) often named <code>requirements.txt</code> and looks something like this:</p> <pre><code>MyApp BeautifulSoup==3.2.1 SomeOtherLib==0.9.4 YetAnother&gt;=0.2 </code></pre> <p>(The fictional file above says: I need exactly BeautifulSoup 3.2.1, SomeOtherLib 0.9.4 and any version of YetAnother greater or equal to 0.2).</p> <p>Then the user of this project can simply take you library, (create a <a href="http://iamzed.com/2009/05/07/a-primer-on-virtualenv/" rel="nofollow">virtualenv</a>) and run</p> <pre><code>$ pip install -r requirements.txt </code></pre> <p>which then will fetch all libraries and makes them available either system-wide of project-wide (if virtualenv is used). Here's a random python project off github, having a requirements file: </p> <ul> <li><a href="https://github.com/laoqiu/pypress" rel="nofollow">https://github.com/laoqiu/pypress</a></li> <li><a href="https://github.com/laoqiu/pypress/blob/master/requirements.txt" rel="nofollow">https://github.com/laoqiu/pypress/blob/master/requirements.txt</a></li> </ul> <p>The nice thing about this approach is that you'll get your transitive dependencies resolved automatically. Also, if you use virtualenv, you'll get a clean separation of your projects and avoid library version collisions.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload