pkg_resource require does not seem to find my egg
I am working on a tool we call dino which uses sqlalchemy 0.5.3 Its an update of a previous version (called dino) which uses sqlalchemy 0.4.4. For reasons I don't have to go into, I would like to have both tools installed on the same host, with almost no changes to the existing tool. Thus both versions of sqlalchemy installed So my solution seemed to be use pkg_resources and egg's: - leave sqlalchemy 0.4.4 in: /usr/lib64/python2.4/site-packages/sqlalchemy - build sqlalchemy 0.5.3 as an Egg and install into: /usr/lib64/python2.4/site-packages/SQLAlchemy-0.5.3-py2.4.egg - in the root package of the new code, specify the correct version from pkg_resources import require; require("SQLAlchemy>=0.5.0") This does not work. It does not seem to find the egg, and only finds the old version, and then (correctly) fails. Trying to read through the pkg_resource.py, I am trying to make sense why this is, and how to get around it. I am having trouble wrapping my head around some of the terms... Am I doing something obviously wrong? Is there a known bug? I have installed setuptools-0.6_rc7 Here is the traceback Traceback (most recent call last): File "/usr/bin/dinoadm", line 8, in ? import dino.cmd.cli File "/usr/lib64/python2.4/site-packages/dino/__init__.py", line 6, in ? require("SQLAlchemy>=0.5.0") File "/usr/lib64/python2.4/site-packages/pkg_resources.py", line 626, in require needed = self.resolve(parse_requirements(requirements)) File "/usr/lib64/python2.4/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 (/usr/lib64/python2.4/site-packages), Requirement.parse('SQLAlchemy>=0.5.0')) Thanx Nicholas
At 05:04 PM 4/6/2009 -0700, Nicholas Veeser wrote:
I am working on a tool we call dino which uses sqlalchemy 0.5.3 Its an update of a previous version (called dino) which uses sqlalchemy 0.4.4.
For reasons I don't have to go into, I would like to have both tools installed on the same host, with almost no changes to the existing tool. Thus both versions of sqlalchemy installed
So my solution seemed to be use pkg_resources and egg's:
- leave sqlalchemy 0.4.4 in: /usr/lib64/python2.4/site-packages/sqlalchemy - build sqlalchemy 0.5.3 as an Egg and install into: /usr/lib64/python2.4/site-packages/SQLAlchemy-0.5.3-py2.4.egg - in the root package of the new code, specify the correct version from pkg_resources import require; require("SQLAlchemy>=0.5.0")
Change this to defining that dependency in its setup.py, and develop using 'setup.py develop'. It will then work correctly.
I am confused. Doesn't this setup a development environment? I am trying to build an OS package (gentoo) for deployment to a number of hosts. I want to install my package, with a SqlAlchemy package (0.5.3), and an existing Sqlalchemy package (0.4.4) and have the packages all get along. My thoughts were that with the appropriate use of pkg_resources.py, I could use WorkSet, Environment, etc to build a sys.path which would correctly have the newer SqlAlchemy egg file in the path. I am doing this manually now, but it seems like pkg_resources.py is a more readable, maintainable method to do the same thing. What I have working is this: dino/__init__.py: .... egg = "SQLAlchemy-0.5.3-py2.4.egg" for p in sys.path[:]: fullname = os.path.join(p, egg) if os.path.exists(fullname): sys.path.insert(sys.path.index(p), fullname) ... On Apr 6, 2009, at 7:49 PM, P.J. Eby wrote:
At 05:04 PM 4/6/2009 -0700, Nicholas Veeser wrote:
I am working on a tool we call dino which uses sqlalchemy 0.5.3 Its an update of a previous version (called dino) which uses sqlalchemy 0.4.4.
For reasons I don't have to go into, I would like to have both tools installed on the same host, with almost no changes to the existing tool. Thus both versions of sqlalchemy installed
So my solution seemed to be use pkg_resources and egg's:
- leave sqlalchemy 0.4.4 in: /usr/lib64/python2.4/site-packages/sqlalchemy - build sqlalchemy 0.5.3 as an Egg and install into: /usr/lib64/python2.4/site-packages/SQLAlchemy-0.5.3-py2.4.egg - in the root package of the new code, specify the correct version from pkg_resources import require; require("SQLAlchemy>=0.5.0")
Change this to defining that dependency in its setup.py, and develop using 'setup.py develop'. It will then work correctly.
participants (2)
-
Nicholas Veeser -
P.J. Eby