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

Solution:
Add Python installation path to the configuration file:
VI/etc/profile

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

Update configuration file
source/etc/profile


Read More: