Error in PIP command execution – syntax error: invalid syntax

An error occurred during PIP executing the command. The exception code is as follows:

Traceback (most recent call last):
  File "/usr/bin/pip", line 7, in <module>
    from pip._internal.main import main
  File "/usr/lib/python2.6/site-packages/pip/_internal/", line 13, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/usr/lib/python2.6/site-packages/pip/_internal/cli/", line 11, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/usr/lib/python2.6/site-packages/pip/_internal/cli/", line 7, in <module>
    from pip._internal.cli import cmdoptions
  File "/usr/lib/python2.6/site-packages/pip/_internal/cli/", line 105
    binary_only = FormatControl(set(), {':all:'})
SyntaxError: invalid syntax

Add Python installation path to the configuration file:

# python
export PATH=/usr/local/python3/bin:$PATH

Update configuration file

Read More: