Python requests_ntlm import error

3

Hello i am receiving the following error when i try to import the requests_ntlm package. I installed the package with easy_install requests-ntlm. I am trying to use this library so that I can log onto an aspx.net webserver with www-authenticate: negotatiate NTLM response header using python. Appreciate any help solving this issue let me know if I need to provide more information. Thanks!

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
python
python-2.7
python-requests
asked on Stack Overflow Dec 26, 2014 by user3474649 • edited Dec 26, 2014 by chown

3 Answers

2

Sorry about that! Package maintainer here.

It looks like it was a problem with Windows. I just released v1.0.2 which fixes this and added Appveyor support to catch these problems in future.

Edit: On a Windows PC you probably hit the error with pip HttpNtlmAuth to fix it you will need to pip requests_ntlm to get v1.0.2.

answered on Stack Overflow Jan 7, 2015 by Rachel Sanders • edited Dec 12, 2019 by Jeremy Thompson
1

Not an answer, however:

I've opened a GitHub issue for this bug: https://github.com/trustrachel/python-ntlm3/issues/6 .

Currently the workaround is to use requests-ntlm version 0.0.3.

answered on Stack Overflow Jan 5, 2015 by Li-aung Yip
0

I also struggled with this problem when I am on

Python 3.7.0
requests-ntlm==1.1.0

Finally SOLVED with different version

Python 3.7.0
requests-ntlm==0.1.0
answered on Stack Overflow Jan 24, 2020 by smartworld-dm

User contributions licensed under CC BY-SA 3.0