pytest -- mac安装了pytest,但是输入pytest却提示命令不存在


原文链接:https://ceshiren.com/t/topic/12822

在pycharm的终端运行pytest,直接输入pytest命令提示:bash: pytest: command not found

解决办法:

在当前环境输入pytest,使用的是Mac自带的python环境(2.7)
如果要使用python3,需要使用python3 -m pytest

输入命令:python3 -m pytest后   完美解决问题