Python3.8.1中运行pytest 6.2.4报错module 'pytest' has no attribute 'hookimpl',怎么处理呢?

代码很简单 1+2 = 3的

def add(a,b):
    return a + b
# 定义一个pytest类
class Test_add:
    # 定义一个pytest方法
    def test_add_001(self):
        result = add(5,8)
        print(result)
    def test_add_002(self):
        result = add(105,9)
        print(result)

无代码错误,应该就是版本不兼容问题 如何处理

img

img

和库同名了,改一下,不要起py什么什么的文件名。
看报错信息,是哪个文件发出的,直接到安装库的目录里面找的pytest模块了,
而你的文件一点错误没发出。
img