2012-12-30 51 views
0

看來Scrypt並沒有安裝在我的機器上。我已經安裝了Windows的版本here。我使用了Visual Studio免費版,安裝了32位OpenSSL,併成功編譯了BCrypt;但SCrypt返回此錯誤:Python-Scrypt不能在Windows 7上安裝64位

> setup.py install 
running install 
running build 
running build_ext 
building 'scrypt' extension 
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DHAVE_CONFIG_H -Iscrypt-1.1.6 -Iscrypt-1.1.6/lib -Iscrypt-1.1.6/lib/scryptenc -Iscrypt-1.1.6/lib/crypto -Iscrypt-1.1.6/lib/util -Ic:\OpenSSL-Win32\include -IC:\Python27\include -IC:\Python27\PC /Tcsrc/scrypt2.c /Fobuild\temp.win-amd64-2.7\Release\src/scrypt2.obj 
scrypt2.c 
scrypt-1.1.6/lib\scryptenc/scryptenc.h(32) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory 
error: command '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.exe"' failed with exit status 2 
Exit code: 1 

UPDATE:複製庫,現在我得到另一個錯誤:

running install 
running build 
running build_ext 
building 'scrypt' extension 
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DHAVE_CONFIG_H -Iscrypt-1.1.6 -Iscrypt-1.1.6/lib -Iscrypt-1.1.6/lib/scryptenc -Iscrypt-1.1.6/lib/crypto -Iscrypt-1.1.6/lib/util -Ic:\OpenSSL-Win32\include -IC:\Python27\include -IC:\Python27\PC /Tcsrc/scrypt2.c /Fobuild\temp.win-amd64-2.7\Release\src/scrypt2.obj 
scrypt2.c 
src/scrypt2.c(72) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int',possible loss of data 
src/scrypt2.c(73) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data 
src/scrypt2.c(87) : error C2143: syntax error : missing ';' before 'type' 
src/scrypt2.c(92) : error C2065: 'value' : undeclared identifier 
src/scrypt2.c(92) : warning C4047: '=' : 'int' differs in levels of indirection from 'PyObject *' 
src/scrypt2.c(96) : error C2065: 'value' : undeclared identifier 
src/scrypt2.c(96) : warning C4047: 'return' : 'PyObject *' differs in levels of indirection from 'int' 
src/scrypt2.c(99) : error C2143: syntax error : missing '{' before '*' 
src/scrypt2.c(132) : error C2143: syntax error : missing ';' before 'type' 
src/scrypt2.c(136) : error C2065: 'value' : undeclared identifier 
src/scrypt2.c(136) : warning C4047: '=' : 'int' differs in levels of indirection from 'PyObject *' 
src/scrypt2.c(139) : error C2065: 'value' : undeclared identifier 
src/scrypt2.c(139) : warning C4047: 'return' : 'int *' differs in levels of indirection from 'int' 
src/scrypt2.c(142) : error C2061: syntax error : identifier 'ScryptMethods' 
src/scrypt2.c(142) : error C2059: syntax error : ';' 
src/scrypt2.c(142) : error C3409: empty attribute block is not allowed 
src/scrypt2.c(142) : error C2513: '/*global*/ ' : no variable declared before '=' 
src/scrypt2.c(151) : error C2065: 'ScryptMethods' : undeclared identifier 
src/scrypt2.c(151) : warning C4047: 'function' : 'PyMethodDef *' differs in levels of indirection from 'int' 
src/scrypt2.c(151) : warning C4024: 'Py_InitModule4_64' : different types for formal and actual parameter 2 
error: command '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.exe"' failed with exit status 2 

UPDATE2:不想使用GCC編譯:

>setup.py build -c mingw32 
running build 
running build_ext 
building 'scrypt' extension 
C:\MinGW64\bin\gcc.exe -mno-cygwin -mdll -O -Wall -DHAVE_CONFIG_H -Iscrypt-1.1.6 - Iscrypt-1.1.6/lib -Iscrypt-1.1.6/lib/scryptenc -Iscrypt-1.1.6/lib/crypto -Iscrypt-1.1.6/lib/util -Ic:\OpenSSL-Win32\include -IC:\Python27\include -IC:\Python27\PC -c src/scrypt2.c -o build\temp.win-amd64-2.7\Release\src\scrypt2.o 
gcc: error: unrecognized command line option '-mno-cygwin' 
error: command 'gcc' failed with exit status 1 

和沒有-mno-cygwingcc --help

編輯n:

>setup.py build -c mingw32 
running build 
running build_ext 
building 'scrypt' extension 
C:\MinGW64\bin\gcc.exe -mdll -O -Wall -DHAVE_CONFIG_H -Iscrypt-1.1.6 -Iscrypt-1.1.6/lib -Iscrypt-1.1.6/lib/scryptenc -Iscrypt-1.1.6/lib/crypto -Iscrypt-1.1.6/lib/util -Ic:\OpenSSL-Win32\include -IC:\Python27\include -IC:\Python27\PC -c src/scrypt2.c -o build\temp.win-amd64-2.7\Release\src\scrypt2.o 
C:\MinGW64\bin\gcc.exe -mdll -O -Wall -DHAVE_CONFIG_H -Iscrypt-1.1.6 -Iscrypt-1.1.6/lib -Iscrypt-1.1.6/lib/scryptenc -Iscrypt-1.1.6/lib/crypto -Iscrypt-1.1.6/lib/util -Ic:\OpenSSL-Win32\include -IC:\Python27\include -IC:\Python27\PC -c scrypt- 1.1.6/lib/crypto/crypto_aesctr.c -o build\temp.win-amd64-2.7\Release\scrypt- 1.1.6\lib\crypto\crypto_aesctr.o 
In file included from scrypt-1.1.6/lib/crypto/crypto_aesctr.c:34:0: 
c:\OpenSSL-Win32\include/openssl/aes.h:1:1: error: expected identifier or '(' before '.' token 
In file included from scrypt-1.1.6/lib/crypto/crypto_aesctr.h:34:0, 
from scrypt-1.1.6/lib/crypto/crypto_aesctr.c:38: 
c:\OpenSSL-Win32\include/openssl/aes.h:1:1: error: expected identifier or '(' before '.' token 
In file included from scrypt-1.1.6/lib/crypto/crypto_aesctr.c:38:0: 
scrypt-1.1.6/lib/crypto/crypto_aesctr.h:51:5: warning: 'struct crypto_aesctr' declared inside parameter list [enabled by default] 
scrypt-1.1.6/lib/crypto/crypto_aesctr.h:51:5: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] 
scrypt-1.1.6/lib/crypto/crypto_aesctr.h:57:32: warning: 'struct crypto_aesctr' declared inside parameter list [enabled by default] 
scrypt-1.1.6/lib/crypto/crypto_aesctr.c:41:2: error: unknown type name 'AES_KEY' 
scrypt-1.1.6/lib/crypto/crypto_aesctr.c:54:20: error: unknown type name 'AES_KEY' 
scrypt-1.1.6/lib/crypto/crypto_aesctr.c:82:1: error: conflicting types for 'crypto_aesctr_stream' 
In file included from scrypt-1.1.6/lib/crypto/crypto_aesctr.c:38:0: 

scrypt-1.1.6/lib/crypto/crypto_aesctr.h:50:6: note: previous declaration of 'crypto_aesctr_stream' was here 
scrypt-1.1.6/lib/crypto/crypto_aesctr.c: In function 'crypto_aesctr_stream': 
scrypt-1.1.6/lib/crypto/crypto_aesctr.c:97:4: warning: implicit declaration of function 'AES_encrypt' [-Wimplicit-function-declaration] 
scrypt-1.1.6/lib/crypto/crypto_aesctr.c: At top level: 
scrypt-1.1.6/lib/crypto/crypto_aesctr.c:113:1: error: conflicting types for 'crypto_aesctr_free' 
In file included from scrypt-1.1.6/lib/crypto/crypto_aesctr.c:38:0: 
scrypt-1.1.6/lib/crypto/crypto_aesctr.h:57:6: note: previous declaration of 'crypto_aesctr_free' was here 
error: command 'gcc' failed with exit status 1 

回答

1

stdint.h是C99的一部分。微軟的C編譯器不支持C99。您可能需要使用另一個編譯器,如MinGW或使用類似msinttypes的東西。

+0

我會嘗試msinttypes,因爲MinGw很難安裝在離線 –

+0

現在得到另一個錯誤(更新) –

+1

@AbdelouahabPp:不幸的是,我看不到會產生你得到的錯誤。我唯一的想法是嘗試MinGW。抱歉。 – icktoofay