pip执行命令过程报错-SyntaxError: invalid syntax

pip执行命令过程中出现错误,异常代码如下:

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

解决方案:
在配置文件中加入Python的安装路径:
vi /etc/profile

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

更新配置文件
source /etc/profile

上一篇:MYSQL安装报错 -- 出现Failed to find valid data directory.


下一篇:C#字典内部数组大小