尝试从 arelle 模块导入 Cntlr 时出现语法错误

Syntax error when trying to import Cntlr from arelle module

我的目标是使用 Arelle(XBRL 社区的开源平台)解析来自 SEC 的 XBRL 文档。

我正在按照找到的说明进行操作 here

我成功git 将Arelle 的code 克隆到Anaconda 的Lib 目录中。但是,当我尝试 from arelle import Cntlr 时,出现以下语法错误。

File "arelle\Cntlr.py", line 573 print(logEntry, file=file) ^ SyntaxError: invalid syntax

我正在使用 Python 2.7.12。在 Anaconda 中。

欢迎任何反馈,我可以根据要求提供更多信息。

您找到的说明相当陈旧(从 2014 年开始),似乎已经过时。

我能够通过以下步骤安装包:

# This is needed because the 3to2 library can't be installed as an egg; if
# you don't install it with `pip` first the installation of Arelle will fail.
$ pip install 3to2
# Install Arelle directly from GitHub, this will take a while
$ pip install git+https://github.com/Arelle/Arelle

安装 3to2 后,安装脚本 setup.py 继续将 Arelle 源代码转换回 Python 2 兼容形式。翻译需要几分钟,请耐心等待。