报错场景:
已经用pip3 install pytest 成功下载pytest,
结果运行python3 -m pytest xxx.py
还是报错
/Library/Developer/CommandLineTools/usr/bin/python3 :NO module named pytest
原因:
可能没有使用正确的PIP和正确的Python解释器。
解决方案:
python3 -m pip install pytest --user
(如果在系统范围内安装,可以省略–user)。