5

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?

Rahul
  • 502
  • 7
  • 16

4 Answers4

0

I had the same problem trying to install version 0.2.1, but then I tried the latest version (0.4.3), and it installed with no problem.

HuLu ViCa
  • 5,077
  • 10
  • 43
  • 93
-2

if you dont have chocolatey installed, install it using these directionschocolatey install

then try

choco install msinttypes

from command prompt.

then try installing thrift_sasl again

WildCard
  • 527
  • 3
  • 8
  • Not able to install `msinttypes` as I don't have admin privileges. Or specifically `Requested registry access is not allowed.` – Rahul May 26 '16 at 09:08
-2

I had the same trouble with you when I tried to install sasl. Here's my solution:

  1. yum search sasl
  2. sudo yum install cyrus-sasl-devel saslwrapper
  3. sudo pip install sasl

Bingo! Hope I can help you with it.

-3

After running the following command, "pip install sasl" and "pip install thrift_sasl" successfully installed.

$ sudo yum install gcc-c++ python-devel.x86_64 cyrus-sasl-devel.x86_64