我在基於Windows的環境(2003,win 7,2008 r2等)上都運行了Python和32位64位風格的Python。我最近不得不使用NTLM和Kerberos身份驗證方案對各種企業內部面向Web站點進行身份驗證。Python Kerberos-1.1.1.tar.gz在Windows上安裝失敗
我使用'requests'模塊成功進行NTLM身份驗證。具體來說,有一些文檔討論了Other Authentication的方法。安裝'requests-ntlm'軟件包效果很好!
不幸的是,我似乎無法得到requests-kerberos包的工作。 requirements.txt表示需要kerberos-1.1.1包,但我無法構建/安裝該包。
這裏是如果我嘗試導入請求的Kerveros庫沒有Kerberos的1.1.1發生了什麼:
>>> import requests
>>> from requests_kerberos import HTTPKerberosAuth
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "requests_kerberos\__init__.py", line 17, in <module>
from .kerberos_ import HTTPKerberosAuth, REQUIRED, OPTIONAL, DISABLED
File "requests_kerberos\kerberos_.py", line 1, in <module>
import kerberos
ImportError: No module named kerberos
>>>
,這裏是試圖從建立Kerberos的1.1.1包時,我的錯誤我的WIN 7的機器(與Python 2.6.5)中的一個:
>python setup.py install --install-lib "C:\tmp"
running install
running build
running build_ext
building 'kerberos' extension
c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox
/MD /W3 /GS- /DNDEBUG -IC:\Python26\ArcGIS10.0\include -IC:\Python26\ArcGIS10.0\
PC /Tcsrc/kerberos.c /Fobuild\temp.win32-2.6\Release\src/kerberos.obj '{' is not
recognized as an internal or external command, operable program or batch file.
cl : Command line warning D9024 : unrecognized source file type ''{'', object fi
le assumed
cl : Command line warning D9027 : source file ''{'' ignored
cl : Command line warning D9024 : unrecognized source file type 'is', object fil
e assumed
cl : Command line warning D9027 : source file 'is' ignored
cl : Command line warning D9024 : unrecognized source file type 'not', object fi
le assumed
cl : Command line warning D9027 : source file 'not' ignored
cl : Command line warning D9024 : unrecognized source file type 'recognized', ob
ject file assumed
cl : Command line warning D9027 : source file 'recognized' ignored
cl : Command line warning D9024 : unrecognized source file type 'as', object fil
e assumed
cl : Command line warning D9027 : source file 'as' ignored
cl : Command line warning D9024 : unrecognized source file type 'an', object fil
e assumed
cl : Command line warning D9027 : source file 'an' ignored
cl : Command line warning D9024 : unrecognized source file type 'internal', obje
ct file assumed
cl : Command line warning D9027 : source file 'internal' ignored
cl : Command line warning D9024 : unrecognized source file type 'or', object fil
e assumed
cl : Command line warning D9027 : source file 'or' ignored
cl : Command line warning D9024 : unrecognized source file type 'external', obje
ct file assumed
cl : Command line warning D9027 : source file 'external' ignored
cl : Command line warning D9024 : unrecognized source file type 'command,', obje
ct file assumed
cl : Command line warning D9027 : source file 'command,' ignored
cl : Command line warning D9024 : unrecognized source file type 'operable', obje
ct file assumed
cl : Command line warning D9027 : source file 'operable' ignored
cl : Command line warning D9024 : unrecognized source file type 'program', objec
t file assumed
cl : Command line warning D9027 : source file 'program' ignored
cl : Command line warning D9024 : unrecognized source file type 'or', object fil
e assumed
cl : Command line warning D9027 : source file 'or' ignored
cl : Command line warning D9024 : unrecognized source file type 'batch', object
file assumed
cl : Command line warning D9027 : source file 'batch' ignored
cl : Command line warning D9024 : unrecognized source file type 'file.', object
file assumed
cl : Command line warning D9027 : source file 'file.' ignored
kerberos.c
\src\kerberosbasic.h(17) : fatal error C108
3: Cannot open include file: 'gssapi/gssapi.h': No such file or directory
error: command '"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.ex
e"' failed with exit status 2
我也已經盡了WIN 2008 R2服務器(與Python 2.7.2)中的一個,卻得到了一個不同的錯誤:
>python.exe "setup.py" install --
install-lib "C:\tmp"
running install
running build
running build_ext
building 'kerberos' extension
error: Unable to find vcvarsall.bat
我認爲這必須做的是,這些都是從源代碼構建,需要某種C或C++編譯器,而我以前安裝的大多數其他模塊工作得很好。任何建議表示讚賞!
Tahnk您的意見!它也適用於我! – user3233941
只是爲了對其他人進行調查,這顯然是一種解決方法,但這個解決方法所需的原因是因爲kerberos軟件包在Windows上不受支持:http://calendarserver.org/ticket/ 828「沒有補丁,這不會被看到,因爲我們沒有活躍的開發人員使用Windows,所以Windows不支持。」 – JSoet
我不相信這是什麼意思是「缺少補丁,這不會得到看因爲我們沒有使用Windows的活躍開發者,所以Windows不受支持。「我幾乎可以肯定,這是指您發現的網站是Mac軟件站點,而不是Kerberos開發站點 – corporateWhore