简体   繁体   English

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

[英]Syntax error when trying to import Cntlr from arelle module

My goal is to use Arelle (open-source platform for XBRL community) to parse XBRL docs from the SEC.我的目标是使用 Arelle(XBRL 社区的开源平台)解析来自美国证券交易委员会的 XBRL 文档。

I am following instructions found here .我正在按照此处找到的说明进行操作。

I successfully git cloned Arelle's code into the Lib directory of Anaconda.我成功地将Arelle的代码git克隆到了Anaconda的Lib目录中。 However, when I try from arelle import Cntlr I get the following syntax error.但是,当我尝试from arelle import Cntlr ,出现以下语法错误。

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

I am using Python 2.7.12.我正在使用 Python 2.7.12。 in Anaconda.在蟒蛇。

Any feedback is appreciated and I can provide further information upon request.感谢任何反馈,我可以根据要求提供更多信息。

The instructions you found are rather old (from 2014), and appear to be outdated.您找到的说明相当旧(从 2014 年开始),并且似乎已经过时。

I was able to install the package with the following steps:我能够通过以下步骤安装该软件包:

# 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

With 3to2 installed, the installation script setup.py proceeds to translate the Arelle sourcecode back to a Python 2 compatible form.安装3to2 ,安装脚本setup.py继续将 Arelle 源代码转换回 Python 2 兼容形式。 Translation takes several minutes, be patient.翻译需要几分钟,请耐心等待。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM