New submission from mbogosian <[email protected]>:

Perhaps I have misunderstood the intended behavior, but I thought one should be 
able to do this:

- - - - - - - - %< - - - - - - - -

% easy_install BeautifulSoup==3.0.8
...
% easy_install -U BeautifulSoup
[installs 3.1.0.1]
...
% python -c 'import pkg_resources ; print 
pkg_resources.require("BeautifulSoup==3.0.8")'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../site-packages/distribute-0.6.10-py2.5.egg/pkg_resources.py", line 
648, in require
    needed = self.resolve(parse_requirements(requirements))
  File ".../site-packages/distribute-0.6.10-py2.5.egg/pkg_resources.py", line 
550, in resolve
    raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (BeautifulSoup 3.1.0.1 
(.../site-packages/BeautifulSoup-3.1.0.1-py2.5.egg), 
Requirement.parse('BeautifulSoup==3.0.8'))

- - - - - - - - >% - - - - - - - -

If I use the '-m' tag (to keep it out of easy_install.pth), I have a different 
problem:

- - - - - - - - %< - - - - - - - -

% easy_install -m BeautifulSoup==3.0.8
...
% easy_install -U -m BeautifulSoup
[installs 3.1.0.1]
...
% python -c 'import pkg_resources ; print 
pkg_resources.require("BeautifulSoup==3.0.8")'
[BeautifulSoup 3.0.8 (.../site-packages/BeautifulSoup-3.0.8-py2.5.egg)]
% python -c 'import BeautifulSoup'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named BeautifulSoup

- - - - - - - - >% - - - - - - - -

Can I not have my cake and eat it too? Meaning, can I not have multiple 
installed versions of a package with a default (i.e., an entry in 
easy-install.pth), but still be able to explicitly specify a previously 
installed version?

----------
messages: 659
nosy: mbogosian
priority: bug
status: unread
title: pkg_resources.require can't deal with multiple installed versions if one 
is present in easy-install.pth

_______________________________________________
Setuptools tracker <[email protected]>
<http://bugs.python.org/setuptools/issue139>
_______________________________________________
_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to