Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip requirement specifiers: role of the comma

I am trying to install a specific version of django-cms, thus executing pip install django-cms==3.0.5. That gives me the error No matching distribution found for django-mptt==0.5.2,==0.6,==0.6.1 (from django-cms==3.0.5). And indeed, on github the setup.py file specifies the requirement django-mptt==0.5.2,==0.6,==0.6.1.

The specification says that the comma serves as a logical 'and' operator but obviously no version can be 0.5.2, 0.6 AND 0.6.1 at the same time and thus the requirement is not matched. Just installing one of those versions via pip install django-mptt==0.5.2 works without a problem but there is still the same error about django-cms==3.0.5.

Can anyone shed light on this?

like image 404
Michel H. Avatar asked Jan 17 '16 16:01

Michel H.


1 Answers

This was a bug in django-cms version 3.0.5. You can see the issue here: https://github.com/divio/django-cms/issues/3704.

You can try installing version 3.0.16 if you need to stay on the 3.0 release. If you REALLY need version 3.0.5, you can install pip==1.5.6, and django-cms should still install properly.

Edit Starting from pip version 6.0, multiple == version specifiers for a single package no longer work. One of the developers commented on Github:

This is the new expected behavior from PEP 440.

The old behavior of setuptools was confusing and didn't do what most people expected it to do. PEP 440 simplified it by changing the , to a logical AND statement.

See https://github.com/pypa/pip/issues/2258.

like image 179
Derek Kwok Avatar answered Oct 19 '22 23:10

Derek Kwok