pip install dá “Objeto TypeError: 'int' não é iterável”

1

Em Debian Stretch , quando tento instalar o pacote python-python-constraint via

pip install python-constraint

Eu recebo o seguinte erro:

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

Em Debian Jessie , o mesmo comando é bem sucedido.

Onde está o problema? Como resolver isso?

$python --version
Python 2.7.9

$pip --version
pip 1.5.6 from /usr/lib/python2.7/dist-packages (python 2.7)
    
por Ortomala Lokni 28.05.2015 / 17:45

1 resposta

5

O erro está relacionado ao bug link

A solução é fazer downgrade de python-distlib e python-distlib-whl para a versão estável (jessie).

wget http://ftp.debian.org/debian/pool/main/d/distlib/python-distlib_0.1.9-1_all.deb
wget http://ftp.debian.org/debian/pool/main/d/distlib/python-distlib-whl_0.1.9-1_all.deb
dpkg -i python-distlib_0.1.9-1_all.deb 
dpkg -i python-distlib-whl_0.1.9-1_all.deb 

Depois disso, executar pip install é bem-sucedido.

$ sudo pip install python-constraint
Downloading/unpacking python-constraint
  Downloading python-constraint-1.2.tar.bz2
  Running setup.py (path:/tmp/pip-build-JeOIzg/python-constraint/setup.py) egg_info for package python-constraint

Installing collected packages: python-constraint
  Running setup.py install for python-constraint

Successfully installed python-constraint
Cleaning up...

Coloque os pacotes em espera e aguarde uma correção oficial de erros.

sudo aptitude hold python-distlib python-distlib-whl
    
por 28.05.2015 / 18:39