栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

allure出现error: unrecognized arguments: --alluredir --clean-alluredir解决办法

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

allure出现error: unrecognized arguments: --alluredir --clean-alluredir解决办法

 本地搭建了一套集成环境,跑的也还顺利,搬到云服务器构建的时候,allure一直报错,提示命令不对,反复对比python各个模块和版本,发现都一样,一直报这个错误

ubuntu@VM-16-9-ubuntu:/var/lib/jenkins/workspace/autotest_daily/pytestdemo$ sudo python3 all.py 
ERROR: usage: all.py [options] [file_or_dir] [file_or_dir] [...]
all.py: error: unrecognized arguments: --alluredir --clean-alluredir
  inifile: /var/lib/jenkins/workspace/autotest_daily/pytestdemo/pytest.ini
  rootdir: /var/lib/jenkins/workspace/autotest_daily/pytestdemo

到处搜了也没找到,以为是allure-pytest的版本有问题,对比了版本号是一样的,因为2个服务器的差异在于源地址的差别,同一个版本还有不一样的吗?卡在这里有个把小时了,执行 sudo pip3 install --upgrade allure-pytest最后有这么一句

Installing collected packages: six, allure-python-commons, allure-pytest
Successfully installed allure-pytest-2.9.45 allure-python-commons-2.9.45 six-1.16.0

问题来了,six的版本不一样,终于找到不一样的了,本地构建用的six版本是1.14.0,服务器用的是1.16.0

尝试降级six的版本

sudo pip3 install six==1.14.0

然后再继续构建,pytest正常执行了,构建就OK了,不得不说,python里面的坑真多。

问题来了,six是干啥的呢?

搜了一遍,这个东西是用来兼容python2和3的模块,由此可见,

allure allure-pytest                     2.9.45              
allure-python-commons             2.9.45  

上头2个模块和six 1.16.0不兼容,所以带来了这种坑。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/603673.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号