我想在Colaboratory上运行一个Python程序。它使用PyCharm成功运行,但它需要__future__
。当我在Colaboratory上尝试时,我得到了这个错误。
from __future__ import annotations
^
SyntaxError: future feature annotations is not defined
关于如何在Colaboratory进口__future__
的任何建议?
谢谢。
__future__
存在。那个特殊的__future__
功能没有。 Google Colaboratory目前使用的是Python 3.6,from __future__ import annotations
是3.7。
如果你需要Python 3.7,你将不得不等待。