尝试在 Windows (x64) 上安装 Python bcrypt 时出现大量问题
这个问题已经在其他地方提到过,但没有提供一个可行的解决方案,所以我仍然想保留一张票。
c:\Users\me\Desktop\temp\py-bcrypt-0.2>setup.py install build --compiler=min gw32 running install 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 build\temp.win32-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
这是在摆脱最初的“错误之后:安装脚本退出并出现错误:无法找到 vcvarsall.bat”,我留下了一个看起来像 Gordic 结的东西。 pip
和 easy-install
不起作用。我还阅读了一些其他文章。
我目前不需要实现bcrypt,所以这不是一个紧急的事情,但显然,实现安全的密码保护至关重要。
This problem has been mentioned elsewhere, but it does not provide a working solution, so I would still like to keep a ticket open.
c:\Users\me\Desktop\temp\py-bcrypt-0.2>setup.py install build --compiler=min gw32 running install 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 build\temp.win32-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
This is after getting rid of the initial “error: Setup script exited with error: Unable to find vcvarsall.bat”, I am left with what seems like a Gordic knot. pip
and easy-install
do not work. I have also read a number of other articles.
I don’t need to implement bcrypt at the moment, so it is not an urgent matter, but obviously, implementing a secure password protection is vital.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设你使用的是mingw64,你应该将ifdefs上的_WIN32中的_MSC_VER更改为bcrypt.c,bcrypt_python.c和pybc_blf.h
(我也回答了另一个问题)
supposing you are using mingw64, you should change _MSC_VER in _WIN32 on ifdefs into bcrypt.c, bcrypt_python.c and pybc_blf.h
(I've also replied the other question)
我发现最简单的方法是下载并安装 Windows 二进制文件,而不是尝试自己编译。 这个人在 bitbucket 上有一些
The simplest way I found was to download and install windows binaries, rather than trying to compile myself. This guy has some on bitbucket