Tay Ray Chuan home archive

pkg_resources.require syntax/format

Thu, 10 Jun 2010 15:45:01 +0800 | Filed under python

In case you're wondering, the syntax/format is similar to what you would use for specifying dependencies in a setup.py.

Here's a fairly complex example of loading a recent django 1.1, but not 1.2:

>>> from pkg_resources import require
>>> require("django >=1.1, <1.2")
[django 1.1.2 (f:\files\python25\lib\site-packages\django-1.1.2-py2.5.egg)]
blog comments powered by Disqus