AttributeError: 模块“asyncio”没有属性“run”

Mih*_*ika 2 python-asyncio python-3.7

我正在尝试使用 asyncio 运行以下程序:

import asyncio

async def main():
    print('Hello')
    await asyncio.sleep(1)
    print('World')

asyncio.run(main())
Run Code Online (Sandbox Code Playgroud)

但是,我收到以下错误:

AttributeError: 模块“asyncio”没有属性“run”

python --version 给出:Python 2.7.8

python3 --version 给出:Python 3.7.1

我将脚本作为python3 script.py运行

关于如何在没有任何错误的情况下运行此程序的任何想法?