python - 在 Windows 中为 Python 安装 thrift_sasl

标签 python visual-c++ pip mingw sasl

我一直在尝试在 Windows 10 x64 中通过 pip 安装 thrift_sasl 包。

thrift_sasl 依赖于 sasl 包,但是在运行 pip install thrift_saslpip install sasl 时,我遇到了同样的错误。

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

问题可能是因为 Visual C++ for Python 不支持旧的 c 头文件。谁能帮我安装一下?

编辑:我安装了 mingw,并尝试使用 pip--compiler=mingw32 选项进行安装。现在它给我以下错误:

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

编辑 2:我下载了 Cyrus sasl C 库并将头文件复制到 mingw 查找头文件的文件夹(即 C:\MinGW\lib\gcc\mingw32\4.9.3\include\sasl)。现在,我得到这个错误:

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

我下载的sasl库好像没有getpass函数。我环顾四周,发现 getpass 函数仅适用于 linux 并更改终端状态,如 linux man page 所示。 .我从 here 下载了库.任何解决方法的想法?

最佳答案

我在尝试安装 0.2.1 版时遇到了同样的问题,但后来我尝试了最新版本 (0.4.3),并且安装没有问题。

关于python - 在 Windows 中为 Python 安装 thrift_sasl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37452024/

相关文章:

python - 如何使用 for 循环将首次使用日期存储在字典中

python - 如何应用 if 条件并应用于数据框

python - 将自定义 pyqtsignal 从一个主窗口发送到另一个主窗口

c++ - 谷歌模拟 : Mocked overloaded functions create warning C4373

python - Windows 上没有适用于 Python 3.5 的 cx_Oracle 吗?

python - pip install 返回 -9

python - 仅当之前未插入分隔符时才插入分隔符

c++ - 自定义分配器泄漏内存

pip - 在Google Colaboratory上安装tensorflow显示依赖问题

visual-c++ - 我如何分发 msvr71.dll (microsoft visual c++ runtime dll)