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

本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://net2asp.com/9362679d10.html