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所遇到的问题,希望对大家有用

猜你喜欢

转载自blog.csdn.net/liuzemeeting/article/details/79510608