Exception: error, not support this platform, only support centos/redhat, suse, ubuntu.

技术分享
2690 3

2023-09-12T07:36:02.png

解决方法:

  1. 查看错误信息:提示不支持我的平台,只支持centos,ubuntu,suse
  2. 但是我的系统就是centos7
  3. 通过查看 comm/check.py文件,发现报错代码块的具体内容如下:

    def installByYum(server):
     if isCentos():
         result = doCmdIgnoreException("sudo yum -y install {}".format(server))
         if result["status"] != 0:
             os.system("sudo yum -y install epel-release")
             os.system("sudo yum -y install python-pip")
             os.system("pip install requests")
             result = doCmd("sudo yum -y install {}".format(server))
     elif isSuse():
         os.system("sudo zypper install -y {}".format(server))
     elif isUbuntu():
         os.system("sudo apt-get install -y {}".format(server))
     else:
         raise Exception("error,not support this platform,only support centos,suse,ubuntu.")
     return
  4. 我猜测,因为linux发行版不同,安装软件的方法也不同,例如:Ubuntu使用apt,centos使用yum。
  5. 只需把 if isCentos(): 修改为1即可
  6. 第五步就是自行修改了代码,因为我是centos系统,但是代码没识别出来,这样修改了以后 ,代码就会使用 yum 命令安装软件(注:如果报相同的错,请根据自己的系统修改这部分代码)
最后更新 2023-09-12
评论 ( 3 )
OωO
隐私评论
  1. 跨境电商b2b平台

    感谢分享

    6个月前上海市徐汇区回复
  2. 改为1就不会执行isCentos()这个函数了,也就默认不检查你机器的系统是什么

    6个月前江苏省常州市回复
    1. 啊哈哈哈
      @戏人看戏

      NBNBNB

      6个月前江苏省回复