SyntaxError: future feature annotations is not defined
SyntaxError: future feature annotations is not defined
我正在尝试运行代码
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
但是,在错误代码中它显示 python veriosn 为 3.6。所以,我不确定哪里出了问题。为什么它不使用我拥有的 python 环境?请帮忙,谢谢。
根据错误,您的代码似乎使用的是 Python 3.6 而不是 Python 3.9。此导入从 Python 3.7 开始可用。检查 run.sh
以确保它引用了正确的 python 解释器。
我还建议使用 virtual env 使用您需要的 python 版本和 运行 您的脚本。
我正在尝试运行代码
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
但是,在错误代码中它显示 python veriosn 为 3.6。所以,我不确定哪里出了问题。为什么它不使用我拥有的 python 环境?请帮忙,谢谢。
根据错误,您的代码似乎使用的是 Python 3.6 而不是 Python 3.9。此导入从 Python 3.7 开始可用。检查 run.sh
以确保它引用了正确的 python 解释器。
我还建议使用 virtual env 使用您需要的 python 版本和 运行 您的脚本。