py-bcrypt在win 7 64bit python上安装

poc*_*chi 6 c python compiler-construction gcc module

试图在win7上安装py-bcrypt.Python是64位.第一个错误无法找到vcvarsall.bat.谷歌搜索了一下,我需要安装mingw.现在安装它

C:\tools\python_modules\py-bcrypt-0.2>python setup.py build -c mingw32
running build
running build_py
running build_ext
building 'bcrypt._bcrypt' extension
C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -Ic:\Python27\include -Ic:\Python27\PC -c bcrypt/bcrypt_python.c -o b
d\temp.win-amd64-2.7\Release\bcrypt\bcrypt_python.o
bcrypt/bcrypt_python.c:29:26: error: expected declaration specifiers or '...' before 'u_int8_t'
bcrypt/bcrypt_python.c:29:38: error: expected declaration specifiers or '...' before 'u_int16_t'
bcrypt/bcrypt_python.c:29:49: error: expected declaration specifiers or '...' before 'u_int8_t'
bcrypt/bcrypt_python.c: In function 'bcrypt_encode_salt':
bcrypt/bcrypt_python.c:56:2: error: too many arguments to function 'encode_salt'
bcrypt/bcrypt_python.c:29:6: note: declared here
error: command 'gcc' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)

不知道接下来该做什么.我想我不会使用bcrypt并尝试别的东西.还有其他建议吗?

小智 8

有一个针对Windows的py-bcrypt的编译版本.您可以访问https://bitbucket.org/alexandrul/py-bcrypt/downloads下载.exe文件并安装.


Ing*_*rad 2

我遇到了同样的问题,我通过应用此链接中找到的补丁来修复它:

http://code.google.com/p/py-bcrypt/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Summary&groupby=&sort=&id=1

py-bcrypt_11.patch

必须手动应用它。

从该线程来看,问题的根源是

根据http://groups.google.com/group/mpir-devel/msg/2c2d4cc7ec12adbb(在各种Windows操作系统、cygwins、mingw和其他操作系统下定义的标志),最好使用_WIN32而不是_MSC_VER,与从 bzero 更改为 memset,这可以在 MSVC 和 MingW32 下编译。

希望有帮助!