Saya memiliki skrip yang bergantung pada hashlib, tetapi ketika saya mencoba sudo pip instal hashlib saya mendapatkan ini:
$ 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/
Apa yang bisa saya lakukan untuk memperbaikinya?
hashlib
menginstal secara default untuk Python 2.7.11 di Ubuntu 16.04, jadi dapatkah Anda memeriksa apakah itu yang terjadi? Jika memang demikian halnya, tidak perlu menginstalnya viapip
.