In Debian Stretch, when I try to install the python package python-constraint via
pip install python-constraint
I get the following error;
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 290, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1178, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 292, in find_requirement
elif is_prerelease(version) and not (self.allow_all_prereleases or req.prereleases):
File "/usr/lib/python2.7/dist-packages/pip/util.py", line 739, in is_prerelease
return any([any([y in set(["a", "b", "c", "rc", "dev"]) for y in x]) for x in parsed])
TypeError: 'int' object is not iterable
Storing debug log for failure in /home/von/.pip/pip.log
In Debian Jessie the same command is sucessful.
Where is the problem? How to solve it?
$python --version
Python 2.7.9
$pip --version
pip 1.5.6 from /usr/lib/python2.7/dist-packages (python 2.7)
Best Answer
The error is related to the bug https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=786580
The solution is to downgrade
python-distlib
andpython-distlib-whl
to the jessie version.After that running
pip install
is sucessful.Put the packages on hold, and wait for an official bug fix.