several version of eggs

Sed briner at gmail.com
Tue Oct 7 10:28:08 EDT 2008


Hello,

I thought that with eggs, I will be able to choose at run time, which
version of an egg I would like to use.

But after some tests with dummy eggs, I've tried to make it work with
SQLAlchemy for example, with no success at all.

So does some one know if such feature is available with eggs ??

------------------ the example ---------------

easy_install 'SQLAlchemy==0.4.4'
...
easy_install 'SQLAlchemy==0.4.6'
...

python
import pkg_resources
>>> pkg_resources.require("SQLAlchemy==0.4.6")
[SQLAlchemy 0.4.6 (/home/system/briner/py-lib/SQLAlchemy-0.4.6-
py2.5.egg)]
>>> pkg_resources.require("SQLAlchemy==0.4.4")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 626,
in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 528,
in resolve
    raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (SQLAlchemy 0.4.6 (/home/system/briner/
py-lib/SQLAlchemy-0.4.6-py2.5.egg),
Requirement.parse('SQLAlchemy==0.4.4'))

Ctrl+D

easy_install 'SQLAlchemy==0.4.4'
...
python
>>> import pkg_resources
>>> pkg_resources.require("SQLAlchemy==0.4.4")
[SQLAlchemy 0.4.4 (/home/system/briner/py-lib/SQLAlchemy-0.4.4-
py2.5.egg)]
>>> pkg_resources.require("SQLAlchemy==0.4.6")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 626,
in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 528,
in resolve
    raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (SQLAlchemy 0.4.4 (/home/system/briner/
py-lib/SQLAlchemy-0.4.4-py2.5.egg),
Requirement.parse('SQLAlchemy==0.4.6'))

-------------------------------
so it feels that the only package I can call is the latest one
installed !!!

cEd



More information about the Python-list mailing list