SyntaxError: future feature annotations is not defined

解决问题

SyntaxError: future feature annotations is not defined

解决思路

语法错误:没有定义future feature注释

解决方法

实际上是python版本不对,该语法需要在python3.7以上,而当前版本在python3.6所以导致此错误!

1、安装python3.7(conda 安装)

conda install python==3.7.0



2、临时将以下注释掉也可以

如果因为无法及时安装,临时将以下注释掉也可以运行当前代码

# from __future__ import annotations
posted @ 2023-03-29 14:40  QYGQH  阅读(509)  评论(0编辑  收藏  举报  来源