写多任务异步协程出了点问题,但报错信息很不对劲

写多任务异步协程出了点问题,但报错信息很不对劲,找不到问题所在
以下是代码:

import asyncio
import time

async def syy1():
    print("syy1 1")
    await asyncio.sleep(3)
    print("syy1 2")

async def syy2():
    print("syy2 1")
    await asyncio.sleep(2)
    print("syy2 2")

async def syy3():
    print("syy3 1")
    await asyncio.sleep(1)
    print("syy3 2")

if __name__ == '__main__':
    # 生成三个异步协程对象
    s1=syy1()
    s2=syy2()
    s3=syy3()
    tasks=[s1,s2,s3]
    #记录时间
    t1=time.time()

    asyncio.run(asyncio.wait(tasks))
    t2=time.time()
    print(t2-t1)

接着是报错信息:

Traceback (most recent call last):
  File "C:/Users/Administrator/Desktop/py爬虫入门/线程,进程和协程/多任务异步协程.py", line 31, in 
    asyncio.run(asyncio.wait(tasks))
AttributeError: module 'asyncio' has no attribute 'run'
sys:1: RuntimeWarning: coroutine 'syy1' was never awaited
sys:1: RuntimeWarning: coroutine 'syy2' was never awaited
sys:1: RuntimeWarning: coroutine 'syy3' was never awaited

将进程分离关了或者重启pycharm

img

瞅瞅行不行
https://blog.csdn.net/lly1122334/article/details/107708156