你能遇到这个错误, 一定是因为你做了一些特殊的事情, 比如我
我把python版本换成 3
执行了如下命令, 当然是先删除原先的python2的软链接
ln -s /usr/local/python3.7.10/bin/python3 /usr/bin/python
ln -s /usr/local/python3.7.10/bin/pip3 /usr/bin/pip
ln -s /usr/local/python3.7.10/bin/python3 /usr/bin/python3
python -m pip install matplotlib
此种改动动了原来的脚本环境, 比如 yum, semanage, firewall-cmd 解决办法很简单, 请看下面
报错:
dss front-end deployment script
linux
File "/bin/yum", line 30
except KeyboardInterrupt, e:
^
SyntaxError: invalid syntax
Nginx installed successfully
File "/bin/yum", line 30
except KeyboardInterrupt, e:
^
SyntaxError: invalid syntax
Traceback (most recent call last):
File "/sbin/semanage", line 1074, in <module>
do_parser()
File "/sbin/semanage", line 1053, in do_parser
args.func(args)
File "/sbin/semanage", line 524, in handlePort
OBJECT = object_dict['port']()
File "/sbin/semanage", line 167, in port_ini
from seobject import portRecords
ModuleNotFoundError: No module named 'seobject'
Traceback (most recent call last):
File "/bin/firewall-cmd", line 24, in <module>
from gi.repository import GObject
ModuleNotFoundError: No module named 'gi'
Traceback (most recent call last):
File "/bin/firewall-cmd", line 24, in <module>
from gi.repository import GObject
ModuleNotFoundError: No module named 'gi'
Succeed to + install DSS & Linkis Web
我们把这些脚本打开,头部第一行会有这样的写法: #!/usr/bin/python
改成 #!/usr/bin/python2 即可
因为python我已经指向了 python3, 而这些命令又是在python2下面运行的