[Distutils] Unexpected VersionConflict

Townsend, Scott E. (GRC-RTM0)[Vantage Partners, LLC] scott.e.townsend at nasa.gov
Fri Aug 9 15:04:50 CEST 2013


That does indeed fix this problem, but requiring an egg writer to
interrogate all dependent packages (and their dependent packagesŠ) and
then hoist the dependencies up won't be robust if those dependent packages
change their requirements between the time the egg is written and the time
it's loaded.

It seems to me that if a requirement has no version specified, then it
shouldn't have a way to cause a VersionConflict. One possible way of
implementing this would be to have resolve() only check that a
distribution exists if no version is specified, do not update 'best'.
'to_activate' would need to be updated with 'generic' distributions only
if a requirement with a version specifier hadn't been seen.

On 8/8/13 7:44 PM, "PJ Eby" <pje at telecommunity.com> wrote:

>On Thu, Aug 8, 2013 at 3:19 PM, Townsend, Scott E. (GRC-RTM0)[Vantage
>Partners, LLC] <scott.e.townsend at nasa.gov> wrote:
>> During easy_install of an egg where two versions of pyparsing were
>>available
>> (1.5.2 and 1.5.6), a VersionConflict was raised:
>>
>> pkg_resources.VersionConflict: (pyparsing 1.5.6
>> (/usr/lib/python2.7/dist-packages),
>>Requirement.parse('pyparsing==1.5.2'))
>>
>> This was unexpected since sys.path (via virtualenv) has version 1.5.2
>>before
>> 1.5.6.  And the system gets 1.5.2 from 'import pyparsing', not 1.5.6.
>
>Have you tried declaring the 1.5.2 dependency from your main project?
>IIRC, that should make it take precedence over either of the indirect
>dependencies.



More information about the Distutils-SIG mailing list