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
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.
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.
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
I had the same issue while connecting to SharePoint using SSO(Single Sign-On)
The following statement solved my problem:
pip install requests_ntlm
Related
I'm using terminal on mac, and anytime I attempt to use pip, I get the following error message telling me that it cannot find a module named zlib:
$ pip --version
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/requests/packages/__init__.py", line 27, in <module>
from . import urllib3
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py", line 8, in <module>
from .connectionpool import (
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 42, in <module>
from .response import HTTPResponse
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 3, in <module>
import zlib
ModuleNotFoundError: No module named 'zlib'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/bin/pip", line 7, in <module>
from pip import main
File "/usr/local/lib/python3.6/site-packages/pip/__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/requests/__init__.py", line 62, in <module>
from .packages.urllib3.exceptions import DependencyWarning
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/requests/packages/__init__.py", line 29, in <module>
import urllib3
File "/usr/local/lib/python3.6/site-packages/urllib3/__init__.py", line 8, in <module>
from .connectionpool import (
File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 36, in <module>
from .response import HTTPResponse
File "/usr/local/lib/python3.6/site-packages/urllib3/response.py", line 3, in <module>
import zlib
ModuleNotFoundError: No module named 'zlib'
I've read several SO posts with the same error message, and have tried their solutions, including attempting to install zlib using homebrew, which fails, and updating my Xcode developer tools. I also installed pip earlier using python get-pip.py, and it said it installed successfully.
The reason I need pip is to install a package for use on python 2.7, but doing $ pip install "package-name" produces the same error as above. I have both Python 2 and 3 installed on my machine, if that helps. I'm kind of new to pip and using the command line in general, and I'm super confused; if anyone could help me out I'd really appreciate it.
This is the OP. I was able to fix the issue, and wanted to post my solution here in case it would help others.
Essentially I believe it occurred because Python2 is default on my machine, but pip is by default pointing to resources pertaining to Python3, or something like that. Doing pip2 --version instead provided the expected response.
I needed to install hashlib for one of my projects, and used easy_install hashlib (as was stated by this Stack Exchange post) to do so. However, right after I installed this package, I haven't been able to use pip at all. Whenever I type a command with pip (like pip install), I get the following error message:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 37, in <module>
import email.parser
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/parser.py", line 12, in <module>
from email.feedparser import FeedParser
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/feedparser.py", line 27, in <module>
from email import message
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/message.py", line 16, in <module>
import email.charset
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/charset.py", line 13, in <module>
import email.base64mime
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/base64mime.py", line 40, in <module>
from email.utils import fix_eols
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/utils.py", line 27, in <module>
import random
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/random.py", line 49, in <module>
import hashlib as _hashlib
File "build/bdist.macosx-10.13-intel/egg/hashlib.py", line 115, in <module>
"""
TypeError: 'frozenset' object is not callable
This also now occurs when I'm using easy_install- same error. I'm also not able to uninstall pip and reinstall- any command with pip results in the error above. Even executing
pip --version yields the same error. I know it's something to do with the hashlib package, but I'm not sure how to delete it and reinstall without messing up my entire Python configurations. My hypothesis is that the version of hashlib I installed is either too old or too new for my Python 2.7, and doesn't play well with it.
Does anyone know what exactly is going on behind the scenes here in this stack trace, and how I can fix pip?
Is the best thing to do to literally go in and delete hashlib.py from my lib/python2.7 folder?
So, this doesn't solve the issue with hashlib, but it does get you a working pip again: literally download and reinstall Python 2.7 all over again from the source. If anyone comes up with a better, more elegant solution for fixing pip, I am all for it.
However, at least I can use pip again...
Hi, is there a solution for this error code ?
Traceback (most recent call last):
File "./weevely.py", line 2, in <module>
from core.terminal import Terminal
File "/Users/ismailtaibi/Desktop/isdo/scripts/weevely/core/terminal.py", line 6, in <module>
from core.module import Status
File "/Users/ismailtaibi/Desktop/isdo/scripts/weevely/core/module.py", line 14, in <module>
from core.vectorlist import VectorList
File "/Users/ismailtaibi/Desktop/isdo/scripts/weevely/core/vectorlist.py", line 15, in <module>
from core.vectors import Os
File "/Users/ismailtaibi/Desktop/isdo/scripts/weevely/core/vectors.py", line 11, in <module>
from mako.template import Template
ImportError: No module named mako.template
Thanks.
The answer is pretty self explainatory and with a google search you could have solved everything in seconds.
Here you have a how to install pip if you don`t have it: How do I install pip on macOS or OS X?
After this type in the terminal:
pip install Mako
as stated in the official website: http://www.makotemplates.org/download.html
If this doesn`t work you can manually download the Mako package here:
https://pypi.python.org/pypi/Mako/
Please, also read this carefully:
https://stackoverflow.com/help/how-to-ask
I'm trying to import the skit-learn library but it´s generate this error:
Traceback (most recent call last):
File "<pyshell#13>", line 1, in <module>
import sklearn
File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\sklearn\__init__.py", line 134, in <module>
from .base import clone
File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\sklearn\base.py", line 12, in <module>
from .utils.fixes import signature
File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\sklearn\utils\__init__.py", line 11, in <module>
from .validation import (as_float_array,
File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\sklearn\utils\validation.py", line 18, in <module>
from ..utils.fixes import signature
File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\sklearn\utils\fixes.py", line 144, in <module>
from scipy.sparse.linalg import lsqr as sparse_lsqr # noqa
File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\sparse\linalg\__init__.py", line 114, in <module>
from .isolve import *
File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\sparse\linalg\isolve\__init__.py", line 6, in <module>
from .iterative import *
File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\sparse\linalg\isolve\iterative.py", line 7, in <module>
from . import _iterative
ImportError: DLL load failed: Não foi possível encontrar o módulo especificado.
Someone could say what's happening, I'm completely lost with this.
Thanks a lot
Sorry if this seems obvious but there's not a lot of information given here so i can't tell what you already tried or not.
This package isn't included in the standard library so you'd have to have downloaded/installed it before importing did you follow the instructions on the library's website? http://scikit-learn.org/stable/install.html
Edit: found a similar issue DLL Load Failed: The specified module could not be found [Python]
I was looking into this not too long ago, I think script on windows is a little tricky. SciPy has directions to an installer on their webpage https://www.scipy.org/install.html. If you've installed python specifically for this project I would go and get anaconda. You can uninstall the python you have or just tell anaconda to replace the path during installation.
Good luck!
Alright guys. I finally could solve the problem.
I don't know why, but I uninstall NumPy, SciPy and Scikit-Learn and install again using the binary files from here:
link
And it's work. All these libraries are working correctly.
Something was running wrong installing from pip.
Well, I think it's case closed. Thank you #Hopeful_O, #juanpa.arrivillaga, #abccd and #shadefc09 for the help.
I use Python 3.2.3
Tonight I tried to install requests from http://docs.python-requests.org/en/latest/ by pip and easy_install, but it doesn't work. I have error when trying to import it. So I decided to use standard library urllib.request and see this error again
That is the traceback:
>>> import requests
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "E:\Python32\lib\site-packages\requests-1.2.0-py3.2.egg\requests\__init__.py", line 52, in <module>
from . import utils
File "E:\Python32\lib\site-packages\requests-1.2.0-py3.2.egg\requests\utils.py", line 12, in <module>
import cgi
File "E:\Python32\lib\cgi.py", line 38, in <module>
from email.parser import FeedParser
File "E:\Python32\lib\email\parser.py", line 12, in <module>
from email.feedparser import FeedParser
File "E:\Python32\lib\email\feedparser.py", line 27, in <module>
from email import message
File "E:\Python32\lib\email\message.py", line 17, in <module>
from email import utils
File "E:\Python32\lib\email\utils.py", line 28, in <module>
import socket
File "E:\Python32\lib\socket.py", line 46, in <module>
import _socket
ImportError: Module use of python26.dll conflicts with this version of Python.
So how can I fix this?
UPD: Solved. It was bug in SublimeREPL, reinstalled that package.
I had a similar problem when I was using PythonXY. The Spyder was not loading and it turns out another software OpenCAD had installed Python2.6 version and that was not letting my Python27.dll to not work. After uninstalling OpenCAD, I was able to run the software.
I was able to troubleshoot by first searching for python26.dll and found that this file was located in the OpenCAD folder location and that made me realize that this software was causing the issue.