Python 安装bcrypt包 在64 Windows上 产生错误的解决方法

来源:互联网 发布:uefitool for mac 编辑:程序博客网 时间:2024/04/30 01:51

1. 打开VS2013 x64 的命令行

2. 执行 python setup.py build

a.  error: Unable to find vcvarsall.bat

安装vs2008 后就没有这个错误了。


b.   正在创建库 build\temp.win-amd64-3.4\Release\bcrypt\_bcrypt.lib 和对象 build\t
emp.win-amd64-3.4\Release\bcrypt\_bcrypt.exp
bcrypt_python.obj : error LNK2019: 无法解析的外部符号 __imp__PyBytes_FromStringA
ndSize,该符号在函数 _checkdup 中被引用
bcrypt_python.obj : error LNK2019: 无法解析的外部符号 __imp__PyUnicode_FromStrin
g,该符号在函数 _bcrypt_encode_salt 中被引用
bcrypt_python.obj : error LNK2019: 无法解析的外部符号 __imp__PyErr_SetString,该
符号在函数 _bcrypt_encode_salt 中被引用
bcrypt_python.obj : error LNK2019: 无法解析的外部符号 __imp___PyArg_ParseTupleAn
dKeywords_SizeT,该符号在函数 _bcrypt_encode_salt 中被引用
bcrypt_python.obj : error LNK2019: 无法解析的外部符号 __imp__PyModule_AddStringC
onstant,该符号在函数 _PyInit__bcrypt 中被引用
bcrypt_python.obj : error LNK2019: 无法解析的外部符号 __imp__PyModule_Create2,
该符号在函数 _PyInit__bcrypt 中被引用
bcrypt_python.obj : error LNK2019: 无法解析的外部符号 __imp__PyEval_SaveThread,
该符号在函数 _checkdup 中被引用
bcrypt_python.obj : error LNK2019: 无法解析的外部符号 __imp__PyEval_RestoreThrea
d,该符号在函数 _checkdup 中被引用
bcrypt_python.obj : error LNK2019: 无法解析的外部符号 __imp___Py_FalseStruct,该
符号在函数 _checkdup 中被引用
bcrypt_python.obj : error LNK2019: 无法解析的外部符号 __imp___Py_TrueStruct,该
符号在函数 _checkdup 中被引用
bcrypt_python.obj : error LNK2019: 无法解析的外部符号 __imp__PyExc_ValueError,
该符号在函数 _bcrypt_encode_salt 中被引用
build\lib.win-amd64-3.4\bcrypt\_bcrypt.pyd : fatal error LNK1120: 11 个无法解析
的外部命令
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\BIN\\
link.exe' failed with exit status 1120

表示你没有从VS2013 x64 的命令行进入,按第一步进入即可。


3. 编译时需要加什么外部库,或者参数什么的,可修改文件:D:\Python34\Lib\distutils\msvc9compiler.py



4. 不bcrypt 使用10轮加密:hashed = bcrypt.hashpw(password, bcrypt.gensalt(10))




0 0
原创粉丝点击