ㄓㄤㄑㄧㄤ

解决 CentOS 7 执行 firewall-cmd 防火墙命令遇到的 ModuleNotFoundError: No module named ‘gi’

网上查了下,出现这个问题是,更新了系统的Python版本,且 version >= Python3,而 CentOS 7 系统自带的是 Python2.7,导致现在 firewall-cmd 运行不了。

解决方法

修改 /usr/bin/firewall-cmd 文件,在 python 后面添加数字 2.7 即可

#!/usr/bin/python2.7 -Es

posted @ 2022-04-06 12:23  ㄓㄤㄑㄧㄤ  阅读(350)  评论(0编辑  收藏  举报
哈哈,页脚部分。