gpt4 book ai didi

Python requests_ntlm导入错误

转载 作者:行者123 更新时间:2023-12-01 14:35:58 25 4
gpt4 key购买 nike

您好,当我尝试导入 requests_ntlm 包时收到以下错误。我用 easy_install requests-ntlm 安装了这个包。我正在尝试使用此库,以便我可以使用 www-authenticate: negotatiate NTLM 响应 header 使用 python 登录到 aspx.net 网络服务器。感谢解决此问题的任何帮助,如果我需要提供更多信息,请告诉我。谢谢!

Traceback (most recent call last):
File "SHS.py", line 2, in <module>
from requests_ntlm import HttpNtlmAuth
File "build\bdist.win-amd64\egg\requests_ntlm\__init__.py", line 1, in <module
>
File "build\bdist.win-amd64\egg\requests_ntlm\requests_ntlm.py", line 4, in <m
odule>
File "C:\python27\lib\site-packages\python_ntlm3-1.0.1-py2.7.egg\ntlm3\__init_
_.py", line 2, in <module>
from . import HTTPNtlmAuthHandler # noqa
File "C:\python27\lib\site-packages\python_ntlm3-1.0.1-py2.7.egg\ntlm3\HTTPNtl
mAuthHandler.py", line 20, in <module>
from . import ntlm
File "C:\python27\lib\site-packages\python_ntlm3-1.0.1-py2.7.egg\ntlm3\ntlm.py
", line 25, in <module>
from . import des
File "C:\python27\lib\site-packages\python_ntlm3-1.0.1-py2.7.egg\ntlm3\des.py"
, line 19, in <module>
from . import des_c
File "C:\python27\lib\site-packages\python_ntlm3-1.0.1-py2.7.egg\ntlm3\des_c.p
y", line 19, in <module>
from .des_data import des_SPtrans, des_skb
File "C:\python27\lib\site-packages\python_ntlm3-1.0.1-py2.7.egg\ntlm3\des_dat
a.py", line 25, in <module>
U32(0x00820200), U32(0x00020000), U32(0x80800000), U32(0x80820200),
File "C:\python27\lib\site-packages\python_ntlm3-1.0.1-py2.7.egg\ntlm3\U32.py"
, line 32, in __init__
value = six.byte2int(value)
File "C:\python27\lib\site-packages\six-1.8.0-py2.7.egg\six.py", line 605, in
byte2int
return ord(bs[0])
TypeError: 'long' object is not subscriptable

最佳答案

对不起!包维护者在这里。

看来这是 Windows 的问题。我刚刚发布了修复此问题的 v1.0.2,并添加了 Appveyor 支持以在未来解决这些问题。

编辑:在 Windows PC 上,您可能使用 pip HttpNtlmAuth 遇到错误来修复它,您需要 pip requests_ntlm 来获取 v1 .0.2.

关于Python requests_ntlm导入错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27660034/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com