原因是PYTHONHOME变量没有配置好,解决方法是在/etc/bashrc加入export PYTHONHOME="python安装路径",如export PYTHONHOME=/usr/local/python2.7;

保存, 在shell输入source /etc/bashrc使其生效