我正在按照https://github.com/ONSBigData/parsing_company_accounts中提供的示例尝试从公司公司电子记录中提取数据。
我在服务器上安装xbrl_parser时遇到问题。当我在终端pip3中运行时,安装xbrl_parser或pip安装xbrl_parser我得到一个错误。
Collecting xbrl_parser
Using cached https://files.pythonhosted.org/packages/9c/72/f8b6d58dfe085a8e9f2b6bf05795f9deb071372d476eb2100f6c0355d803/xbrl_parser-0.1.tar.gz
此方法有效,但我得到后立即使用:
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o3r0rklc/xbrl-parser/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o3r0rklc/xbrl-parser/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-o3r0rklc/xbrl-parser/pip-egg-info
cwd: /tmp/pip-install-o3r0rklc/xbrl-parser/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-o3r0rklc/xbrl-parser/setup.py", line 8, in <module>
long_description=open('README.md').read(),
FileNotFoundError: [Errno 2] No such file or directory: 'README.md'
----------------------------------------
错误:命令错误,退出状态为1:python setup.py egg_info检查日志以获取完整的命令输出。
这是我第一次尝试安装的不是主要的python库,所以我不确定从git获取库时是否需要做其他事情。
请告知如何安装。
我使用-Unable to install python library from github中概述的方法找到了解决分发错误的方法
所以我从https://github.com/ONSBigData/ONSBigData.github.io下载了GutHub项目,并手动将xbrl_parser.py和xbrl_image_parser.py复制到了我的当前文件夹(我有Jupyter笔记本的文件夹)中,并且它是sys.path的路径,如下所示:
import sys
sys.path.append("Path to xbrl_parser.py repo")
install xbrl_parser as xp
怀疑,即使我不添加路径也可以正常工作,因为我在运行项目的同一位置复制了xbrl_parser.py和xbrl_image_parser.py。