I have been trying to install the thrift_sasl
package through pip
in Windows 10 x64.
The thrift_sasl
depends on the sasl
package, but on running pip install thrift_sasl
or pip install sasl
, I run into the same error.
creating build\temp.win-amd64-2.7\Release\sasl
C:\Users\user\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Isasl -Ic:\python27\include -Ic:\python27\PC /Tpsasl/saslwrapper.cpp /Fobuild\temp.win-amd64-2.7\Release\sasl/saslwrapper.obj
saslwrapper.cpp
sasl/saslwrapper.cpp(247) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
error: command 'C:\\Users\\user\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2
The problem is probably because Visual C++ for Python does not support older c header files. Can anyone help me with the installation?
Edit: I installed mingw, and tried to install using the --compiler=mingw32
option of pip
. Now it gives me the following error:
C:\MinGW\bin\gcc.exe -mdll -O -Wall -Isasl -Ic:\python27\include -Ic:\python27\PC -c sasl/saslwrapper.cpp -o build\temp.win-amd64-2.7\Release\sasl\saslwrapper.o
In file included from sasl/saslwrapper.cpp:254:0:
sasl/saslwrapper.h:22:23: fatal error: sasl/sasl.h: No such file or directory
#include <sasl/sasl.h>
^
compilation terminated.
error: command 'C:\\MinGW\\bin\\gcc.exe' failed with exit status 1
Edit 2: I downloaded the Cyrus sasl C library and copied the header files to the folder from where mingw looks for header files(i.e. C:\MinGW\lib\gcc\mingw32\4.9.3\include\sasl
). Now, I get this error:
In file included from sasl/saslwrapper.cpp:254:0:
sasl/saslwrapper.h: In member function 'void saslwrapper::ClientImpl::interact(sasl_interact_t*)':
sasl/saslwrapper.h:442:41: error: 'getpass' was not declared in this scope
char* pass = getpass(ppt.c_str());
^
sasl/saslwrapper.h:437:11: warning: unused variable 'input' [-Wunused-variable]
char* input;
^
sasl/saslwrapper.cpp: In function 'void __Pyx_RaiseArgtupleInvalid(const char*, int, Py_ssize_t, Py_ssize_t, Py_ssize_t)':
sasl/saslwrapper.cpp:3225:59: warning: unknown conversion type character 'z' in format [-Wformat=]
(num_expected == 1) ? "" : "s", num_found);
^
sasl/saslwrapper.cpp:3225:59: warning: format '%s' expects argument of type 'char*', but argument 5 has type 'Py_ssize_t {aka int}' [-Wformat=]
sasl/saslwrapper.cpp:3225:59: warning: unknown conversion type character 'z' in format [-Wformat=]
sasl/saslwrapper.cpp:3225:59: warning: too many arguments for format [-Wformat-extra-args]
error: command 'C:\\MinGW\\bin\\gcc.exe' failed with exit status 1
It seems that the sasl library I downloaded does not have any function getpass
. I looked around and found that the getpass
function works only on linux and changes the terminal state as shown on the linux man page. I downloaded the library from here. Any ideas for any workaround?