1. 程式人生 > >TypeError: 'frozenset' object is not callable

TypeError: 'frozenset' object is not callable

1.python2.7安裝hashlib時出現 TypeError: ‘frozenset’ object is not callable錯誤
2.pip安裝失敗之後可以試下easy-install hashlib出錯Microsoft Visual C++ 9.0 is required < Unable to find vcvarsall.bat,這時候需要下載microso官網下載Microsoft Visual C++ Compiler for Python 2.7
3.繼續easy-install安裝hashlib,如果出現下面錯誤UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xc1 in position 9: ordinal not in range(128),修改編碼為gbk,修改D:\Python27\Lib\ntpath.py(位置由個人python安裝目錄決定)檔案中的def join(path, *paths)函式,在函式內第一行加入
def join(path, *paths):
"""Join two or more pathname components, inserting "\\" as needed."""
reload(sys)
sys.setdefaultencoding('gbk')
result_drive, result_path = splitdrive(path)
for p in paths:
p_drive, p_path = splitdrive(p)
if p_path and p_path[0] in '\\/':
# Second path is absolute
if p_drive or not result_drive:
result_drive = p_drive
result_path = p_path
continue
elif p_drive and p_drive != result_drive:
if p_drive.lower() != result_drive.lower():
# Different drives => ignore the first path entirely
result_drive = p_drive
result_path = p_path
continue
# Same drive in different case
result_drive = p_drive
# Second path is relative to the first
if result_path and result_path[-1] not in '\\/':
result_path = result_path + '\\'
result_path = result_path + p_path
## add separator between UNC and non-absolute path
if (result_path and result_path[0] not in '\\/' and
result_drive and result_drive[-1:] != ':'):
return result_drive + sep + result_path
return result_drive + result_path


這是我裝hashlib所遇到的問題,希望對大家有用