several version of eggs

S

Sed

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[SQLAlchemy 0.4.6 (/home/system/briner/py-lib/SQLAlchemy-0.4.6-
py2.5.egg)]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[SQLAlchemy 0.4.4 (/home/system/briner/py-lib/SQLAlchemy-0.4.4-
py2.5.egg)]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'))
 
D

Diez B. Roggisch

Sed said:
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[SQLAlchemy 0.4.6 (/home/system/briner/py-lib/SQLAlchemy-0.4.6-
py2.5.egg)]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[SQLAlchemy 0.4.4 (/home/system/briner/py-lib/SQLAlchemy-0.4.4-
py2.5.egg)]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'))

you need to easy_install with -m/--multi-version. All of your packages.

Diez
 
S

Sed

you need to easy_install with -m/--multi-version. All of your packages.
Unfortunately, this is not even working :(
let's try it:

$ easy_install -m 'SQLAlchemy==0.4.6'
....
$ easy_install -m 'SQLAlchemy==0.4.4'
....

check that the easy-install.pth doesn't contain any more some sql
entry:
$ grep -i sql /home/system/briner/py-lib/easy-install.pth
../SQLObject-0.9.4-py2.4.egg
no more sqlachemy in it

$ python[SQLAlchemy 0.4.4 (/home/system/briner/py-lib/SQLAlchemy-0.4.4-
py2.5.egg)]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'))

CTRL+D

So it seems that we still have the same behavior as described before

cEd
 
D

Diez B. Roggisch

Sed said:
Unfortunately, this is not even working :(

It is.

dir@client8049:/tmp$ virtualenv --no-site-packages test
New python executable in test/bin/python2.5
Installing setuptools............done.
dir@client8049:/tmp$ . test/bin/activate
(test)dir@client8049:/tmp$ easy_install-2.5 -m SQLAlchemy==0.4.4
Searching for SQLAlchemy==0.4.4
Reading http://pypi.python.org/simple/SQLAlchemy/
Reading http://www.sqlalchemy.org
Best match: SQLAlchemy 0.4.4
Downloading
http://pypi.python.org/packages/sou....4.4.zip#md5=4b1d072f6493421088126e451bd8cb6e
Processing SQLAlchemy-0.4.4.zip
Running SQLAlchemy-0.4.4/setup.py -q
bdist_egg --dist-dir /tmp/easy_install-xhMYOI/SQLAlchemy-0.4.4/egg-dist-tmp-WTjxmH
zip_safe flag not set; analyzing archive contents...
sqlalchemy.databases.mysql: module MAY be using inspect.stack

Installed /tmp/test/lib/python2.5/site-packages/SQLAlchemy-0.4.4-py2.5.egg

Because this distribution was installed --multi-version, before you can
import modules from this package in an application, you will need to
'import pkg_resources' and then use a 'require()' call similar to one of
these examples, in order to select the desired version:

pkg_resources.require("SQLAlchemy") # latest installed version
pkg_resources.require("SQLAlchemy==0.4.4") # this exact version
pkg_resources.require("SQLAlchemy>=0.4.4") # this version or higher

Processing dependencies for SQLAlchemy==0.4.4
Finished processing dependencies for SQLAlchemy==0.4.4
(test)dir@client8049:/tmp$ easy_install-2.5 -m SQLAlchemy==0.4.6
Searching for SQLAlchemy==0.4.6
Reading http://pypi.python.org/simple/SQLAlchemy/
Reading http://www.sqlalchemy.org
Best match: SQLAlchemy 0.4.6
Downloading
http://pypi.python.org/packages/sou...6.tar.gz#md5=3d1e737bb408de25b2fadb19a736b40e
Processing SQLAlchemy-0.4.6.tar.gz
Running SQLAlchemy-0.4.6/setup.py -q
bdist_egg --dist-dir /tmp/easy_install-pJtAmh/SQLAlchemy-0.4.6/egg-dist-tmp-PW4OHw
zip_safe flag not set; analyzing archive contents...
sqlalchemy.databases.mysql: module MAY be using inspect.stack

Installed /tmp/test/lib/python2.5/site-packages/SQLAlchemy-0.4.6-py2.5.egg

Because this distribution was installed --multi-version, before you can
import modules from this package in an application, you will need to
'import pkg_resources' and then use a 'require()' call similar to one of
these examples, in order to select the desired version:

pkg_resources.require("SQLAlchemy") # latest installed version
pkg_resources.require("SQLAlchemy==0.4.6") # this exact version
pkg_resources.require("SQLAlchemy>=0.4.6") # this version or higher

Processing dependencies for SQLAlchemy==0.4.6
Finished processing dependencies for SQLAlchemy==0.4.6
(test)dir@client8049:/tmp$ python2.5
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.Traceback (most recent call last):
[SQLAlchemy 0.4.4
(/tmp/test/lib/python2.5/site-packages/SQLAlchemy-0.4.4-py2.5.egg)]
Diez
 
S

Sed


I see !!! thanks !!!

the fact is that if you have only one egg of sqlachemy module (for
example) which was not installed with easy_install -m, then you get
stuck !

I was having 3 eggs for sqlalchemy:- 2 of them with -m
- 1 of them without -m (that was
the mistake).

thanks again.

cEd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top