Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It depends. If none of the packages that are importing <code>somepackage</code> use the <code>setuptools</code> API, then it works as described above. If any packages in your virtualenv use <code>setuptools</code> (or <code>Distribute</code>) to specify specific version requirements for <code>somepackage</code>, <code>setuptools</code> will search for a version of <code>somepackage</code> that meets the requirements. If it can't find a suitable installed version at install time, it will search externally and attempt to install it. If it can't find one at runtime, the program fails with an exception.</p> <pre><code>from setuptools import setup setup( name = "HelloWorld", version = "0.1", scripts = ['say_hello.py'], install_requires = ['somepackage == 1.0.0'], ) </code></pre> <p>For example, if <code>somepackage 1.0.0</code> was already installed in the system site-packages, everything is fine. If you then update the system site-packages to <code>somepackage 2.0.0</code> with <code>pip</code>, which uninstalls the old version, the script will fail at runtime with:</p> <pre><code>pkg_resources.DistributionNotFound: somepackage==1.0.0 </code></pre> <p>If you installed both versions of <code>somepackage</code> with <code>easy_install</code> instead of <code>pip</code>, things would normally be different. By default, <code>easy_install</code> does not uninstall packages and it supports multiple versions of packages (multi-version eggs). So both versions of <code>somepackage</code> would be available in the system site-packages and the script would not fail.</p> <p><code>setuptools</code> (and the <code>Distribute</code> clone of it) has to jump through many hoops to make the multiple version support work reasonably. Many developers frown on all that extra complexity and argue that it is easier and more transparent to support multiple versions of packages with separate <code>virutalenv</code>'s and, for that, the simpler model of <code>pip</code> is more appropriate. (In fairness to <code>setuptools</code>, <code>virtualenv</code> came along later.)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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