[Distutils] Two versions of SQLAlchemy side-by-side?
skip at pobox.com
skip at pobox.com
Tue Apr 29 17:42:56 CEST 2008
Alexander> The quick hack to request a version, good to use in the
Alexander> interpreter or a "throw-away" script:
Alexander> import pkg_resources
Alexander> pkg_resources.require('SQLAlchemy==0.4.5')
Alexander> import sqlalchemy
Alexander> This works when the directory that SQLAlchemy-0.4.5-py2.4.egg
Alexander> is in is listed in sys.path.
Thanks, however that raises a VersionConflict exception:
>>> pkg_resources.require('SQLAlchemy==0.4.5')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/opt/app/g++lib6/python-2.4.5/lib/python2.4/site-packages/setuptools-0.6c7-py2.4.egg/pkg_resources.py", line 626, in require
needed = self.resolve(parse_requirements(requirements))
File "/opt/app/g++lib6/python-2.4.5/lib/python2.4/site-packages/setuptools-0.6c7-py2.4.egg/pkg_resources.py", line 528, in resolve
raise VersionConflict(dist,req) # XXX put more info here pkg_resources.VersionConflict: (SQLAlchemy 0.3.3
(/opt/app/g++lib6/python-2.4.5/lib/python2.4/site-packages/SQLAlchemy-0.3.3-py2.4.egg), Requirement.parse('SQLAlchemy==0.4.5'))
I need 0.3.3 to be the default version, but need to be able to import 0.4.5
for testing.
Thx,
Skip
More information about the Distutils-SIG
mailing list