【发布时间】:2021-12-29 04:40:04
【问题描述】:
我正在尝试运行代码
sh run.sh
它向我显示了错误
File "/anaconda3/envs/_galaxy_/lib/python3.6/site-packages/filelock/__init__.py", line 8
from __future__ import annotations
^
SyntaxError: future feature annotations is not defined
我看到一些解决方案表明我需要更新我的 python 版本,但我使用的是 python 版本 3.9.7。
(py39) KedeMacBook-Pro:~ ke$ python --version
Python 3.9.7
但是,在错误代码中,它显示了 3.6 的 python 版本。所以,我不确定哪里出错了。为什么它不使用我拥有的 python 环境?请帮忙,谢谢。
【问题讨论】:
-
from __future__ import annotations仅适用于 Python3.7 -
这能回答你的问题吗? Can't import annotations from __future__