问题描述
我正在遵循本指南:https://youtu.be/p36tXHX1JD8 (26:23)我像视频中一样在 brownie-cinfig.yaml 中输入了所有内容
I am following this guide: https://youtu.be/p36tXHX1JD8 (26:23)I typed everything in the brownie-cinfig.yaml like in the video
dependencies:
— OpenZeppelin/openzeppelin—contracts@3.4.0
— smartcontractkit/chainlink—brownie—contracts@1.0.2
compiler:
solc:
remappings:
— '@openzeppelin=OpenZeppelin/openzeppelin—contracts@3.4.0'
— '@chainlink=smartcontractkit/chainlink—brownie—contracts@1.0.2'
但我收到此错误:
File "yaml/scanner.py", line 291, in stale_possible_simple_keys
raise ScannerError("while scanning a simple key", key.mark,
ScannerError: while scanning a simple key
in "/mnt/c/Users/Public/nft-from-scratch/brownie-config.yaml", line 3, column 1
could not find expected ':'
in "/mnt/c/Users/Public/nft-from-scratch/brownie-config.yaml", line 4, column 1
可能有什么问题?我知道代码缺少:",但在视频中没有额外的:"并且代码工作正常.我尝试将 ':' 添加到第 3/4 行的末尾,但仍然出现错误.只是那个错误现在是:TypeError: 'NoneType' object is not iterable
所以我不认为这些行应该以 ':'
What could be wrong? I understand the code is missing ':', but on the video there are no extra ':' and code works fine. I tried adding ':' to the ends of line 3/4, but I still get error. It's just that that error is now: TypeError: 'NoneType' object is not iterable
So I don't think these lines should end with ':'
推荐答案
您需要使用 ASCII 连字符减号 (-
) 而不是 Unicode 破折号 (—
).尽管它们看起来非常相似,但 YAML 仅将前者理解为其语法中的特殊字符.
You need to use an ASCII Hyphen-minus (-
) instead of a Unicode em dash (—
). While they look quite similar, YAML understands only the former one as special character in its syntax.
这篇关于brownie-config.yaml 中的 ScannerError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!