Help me please, urllib3 ntlm "SyntaxError: Missing parentheses in call to 'print'. Did you mean"

Environment

  • pip version: 20.1.1-2
  • Python version: 2.x, 3.0, 3.8.
  • OS: kali linux

How to Reproduce

Just try to use pip.
NOTE: “pythonx -m pip” does not exist
PIP WORK USING “python3.9 -m pip”

Output

#pip

Traceback (most recent call last):
File “/usr/bin/pip”, line 11, in
load_entry_point(‘pip==20.1.1’, ‘console_scripts’, ‘pip’)()
File “/usr/lib/python3/dist-packages/pkg_resources/ init .py”, line 473, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/lib/python3/dist-packages/pkg_resources/ init .py”, line 2843, in load_entry_point
return ep.load()
File “/usr/lib/python3/dist-packages/pkg_resources/ init .py”, line 2447, in load
return self.resolve()
File “/usr/lib/python3/dist-packages/pkg_resources/ init .py”, line 2453, in resolve
module = import (self.module_name, fromlist=[’ name '], level=0)
File “/usr/lib/python3/dist-packages/pip/_internal/cli/main.py”, line 10, in
from pip._internal.cli.autocompletion import autocomplete
File “/usr/lib/python3/dist-packages/pip/_internal/cli/autocompletion.py”, line 9, in
from pip._internal.cli.main_parser import create_main_parser
File “/usr/lib/python3/dist-packages/pip/_internal/cli/main_parser.py”, line 7, in
from pip._internal.cli import cmdoptions
File “/usr/lib/python3/dist-packages/pip/_internal/cli/cmdoptions.py”, line 24, in
from pip._internal.cli.progress_bars import BAR_TYPES
File “/usr/lib/python3/dist-packages/pip/_internal/cli/progress_bars.py”, line 7, in
from pip._vendor import six
File “/usr/lib/python3/dist-packages/pip/_vendor/ init .py”, line 93, in
vendored(“requests.packages.urllib3.contrib.ntlmpool”)
File “/usr/lib/python3/dist-packages/pip/_vendor/ init .py”, line 36, in vendored
import (modulename, globals(), locals(), level=0)
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 655, in _load_unlocked
File “”, line 618, in _load_backward_compatible
File “”, line 259, in load_module
File “/usr/share/python-wheels/urllib3-1.25.9-py2.py3-none-any.whl/urllib3/contrib/ntlmpool.py”, line 9, in
File “/usr/local/lib/python3.8/dist-packages/ntlm/ntlm.py”, line 112
print “NTLM_NegotiateUnicode set”
^
SyntaxError: Missing parentheses in call to ‘print’. Did you mean print(“NTLM_NegotiateUnicode set”)?

Guys if i wrong the place of the ask, sorry in advance i really need help :\
i’ve been trying --reinstall and does not work.

Not sure what ntlm is, but it looks like it has some Python 2 syntax that is getting triggered during installation.

2 Likes

Thanks by the answer, what i suppose to do to fix it?i cant work because that :frowning:

Fagner wrote:

“”"
How to Reproduce

Just try to use pip.
“”"

Tens of thousands of people use pip every single day. I think that if it
were that easy to reproduce the problem, we would have heard thousands
of bug reports about this by now.

Can you be more precise? Your description contradicts yourself: first
you say “just use pip”, then you say “python3.9 -m pip”, then you show
something that looks like:

#pip

which I guess means that you have run the pip command as root. But you
don’t tell us where you are running it from (the directory). If you run
pip from inside a Python package directory, you could pick up the wrong
libraries. What does pwd display?

The “pip” command usually runs Python 2 and its version of pip. But from
the traceback, you are picking up the Python 3 version of pip. So I
cannot guess what you have done to make the Python2 pip run code in
Python3. Maybe you have cd’ed into the Python 3 library and then tried
to run pip version 2?

You have:

Traceback (most recent call last):
File "/usr/bin/pip", line 11

Start by running pip --version and see what it says.

Then run pip3 --version and see what it says.

It is important that you only use the correct pip for the Python you are
using.

You have:

File "/usr/local/lib/python3.8/dist-packages/ntlm/ntlm.py", line 112
print "NTLM_NegotiateUnicode set"
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("NTLM_NegotiateUnicode set")?

This suggests that you somehow have installed the Python2 version of
ntlm inside the Python3.8 directory. I can’t guess how you did that, or
whether it is something you did or a packaging problem. Maybe you
installed it with your Kali Linux packaging manager, and the bug is
there?

1 Like

[… detailed environment spec and traceback snipped …]

File “”, line 259, in load_module
File “/usr/share/python-wheels/urllib3-1.25.9-py2.py3-none-any.whl/urllib3/contrib/ntlmpool.py”, line 9, in

File “/usr/local/lib/python3.8/dist-packages/ntlm/ntlm.py”, line 112
print “NTLM_NegotiateUnicode set”
^
SyntaxError: Missing parentheses in call to ‘print’. Did you mean print(“NTLM_NegotiateUnicode set”)?

Guys if i wrong the place of the ask, sorry in advance i really need help :
i’ve been trying --reinstall and does not work.

It looks like you’ve got a Python2 flavour of urllib3 installed. Can you
reinstall that?

Just looking, conceivably your OS has a Python 2 urllib3 library. Use
pip to install urllib3 into your personal setup to see if that helps
you.

Also, just for reliability, Mats’ advice is to get pip itself from the
Python you’re using, like this:

python3.8 -m pip install urllib3

This prevents accidentally grabbing the wrong “pip”.

Cheers,
Cameron Simpson cs@cskk.id.au

1 Like

Thanks for the answer, about running the commands all of them results in same error, pip --version and pip3 --version.

I cant run the pip, pip root or not return the erro.

Thanks Cameron, i try and return that module not exist

python -m pip
python2 -m pip
python2.7 -m pip
python3 -m pip
python3.8 -m pip

All of them return that pip module do not exist.

pip stay work only in python3.9

I solve the error and conflites manually installing pip in each python version using get-pip.py script.

https://bootstrap.pypa.io/get-pip.py

I download it and run for every python version. now

pip

its run, thanks for everyone that try help me.