gpt4 book ai didi

python - 检查错误 : AttributeError: type object 'Lark' has no attribute '_load_from_dict

转载 作者:行者123 更新时间:2023-12-03 07:34:22 25 4
gpt4 key购买 nike

我在运行 checkov 时遇到一些问题,我不熟悉 python 库,任何人都可以给我一些提示吗?

这在某些机器上运行良好,但在这台机器上尤其不行......

在 CentOS 中运行:

$ checkov --directory cdk.out

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in <module>
from checkov.main import run
File "/usr/local/lib/python3.6/site-packages/checkov/main.py", line 22, in <module>
from checkov.terraform.plan_runner import Runner as tf_plan_runner
File "/usr/local/lib/python3.6/site-packages/checkov/terraform/plan_runner.py", line 11, in <module>
from checkov.terraform.context_parsers.registry import parser_registry
File "/usr/local/lib/python3.6/site-packages/checkov/terraform/context_parsers/__init__.py", line 1, in <module>
from checkov.terraform.context_parsers.parsers import *
File "/usr/local/lib/python3.6/site-packages/checkov/terraform/context_parsers/parsers/provider_context_parser.py", line 1, in <module>
import hcl2
File "/usr/local/lib/python3.6/site-packages/hcl2/__init__.py", line 5, in <module>
from .api import load, loads
File "/usr/local/lib/python3.6/site-packages/hcl2/api.py", line 4, in <module>
from hcl2.parser import hcl2
File "/usr/local/lib/python3.6/site-packages/hcl2/parser.py", line 53, in <module>
hcl2 = Lark_StandAlone(transformer=DictTransformer())
File "/usr/local/lib/python3.6/site-packages/hcl2/lark_parser.py", line 8, in Lark_StandAlone
return Lark._load_from_dict(DATA, MEMO, **kwargs)
AttributeError: type object 'Lark' has no attribute '_load_from_dict'

最佳答案

将 python 从 3.6 升级到 3.8 并重新安装 checkov 后,它工作得很好。

关于python - 检查错误 : AttributeError: type object 'Lark' has no attribute '_load_from_dict,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68255597/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com