python hashlib falha ao instalar o pip

6

Eu tenho um script que depende do hashlib, mas quando eu tento o sudo pip install hashlib eu recebo isso:

$ sudo pip install hashlib
Collecting hashlib
  Downloading hashlib-20081119.zip (42kB)
    100% |████████████████████████████████| 51kB 610kB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/lib/python2.7/dist-packages/setuptools/__init__.py", line 12, in <module>
        from setuptools.extension import Extension
      File "/usr/lib/python2.7/dist-packages/setuptools/extension.py", line 8, in <module>
        from .dist import _get_unpatched
      File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 16, in <module>
        from setuptools.depends import Require
      File "/usr/lib/python2.7/dist-packages/setuptools/depends.py", line 6, in <module>
        from setuptools import compat
      File "/usr/lib/python2.7/dist-packages/setuptools/compat.py", line 17, in <module>
        import httplib
      File "/usr/lib/python2.7/httplib.py", line 80, in <module>
        import mimetools
      File "/usr/lib/python2.7/mimetools.py", line 6, in <module>
        import tempfile
      File "/usr/lib/python2.7/tempfile.py", line 35, in <module>
        from random import Random as _Random
      File "/usr/lib/python2.7/random.py", line 49, in <module>
        import hashlib as _hashlib
      File "hashlib.py", line 115, in <module>
        f()
    TypeError: 'frozenset' object is not callable

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-BbiB5F/hashlib/

O que posso fazer para corrigir isso?

    
por j0h 10.05.2016 / 14:54

3 respostas

7

Teve o mesmo erro. Experimente easy_install hashlib

    
por ThP 28.06.2016 / 23:09
6

Eu encontrei o mesmo problema no mais recente Ubuntu 16 Desktop.
A correção rápida e suja é remover o /usr/lib/python2.7/lib-dynload/_hashlib.x86_64-linux-gnu.so file .

    
por ohm42 10.05.2016 / 16:36
1

Depois de remover /usr/lib/python2.7/lib-dynload/_hashlib.x86_64-linux-gnu.so , preciso executar mais uma etapa

sudo pip install python-dev

Depois disso, execute sudo pip install hashlib com sucesso.

    
por BMW 04.05.2018 / 09:26