1

This is the code in my brownie.config.yaml file:

# exclude SafeMath when calculating test coverage
# https://eth-brownie.readthedocs.io/en/v1.10.3/config.html#exclude_paths
reports:
  exclude_contracts:
    - SafeMath
dependencies:
  - smartcontractkit/chainlink-brownie-contracts@1.0.2
  - OpenZeppelin/openzeppelin-contracts@3.4.0
compiler:
  solc:
    remappings:
      - '@chainlink=smartcontractkit/chainlink-brownie-contracts@1.0.2'
      - '@openzeppelin=OpenZeppelin/openzeppelin-contracts@3.4.0'
      
 wallets:
  from_key: ${PRIVATE_KEY}
  from_mnemonic: ${MNEMONIC} 

The error I receive when I try to run 'brownie run scripts/advanced_collectible/deploy_advanced.py":

brownie run scripts/advanced_collectible/deploy_advanced.py 
Brownie v1.14.3 - Python development framework for Ethereum

  File "brownie/_cli/__main__.py", line 64, in main
    importlib.import_module(f"brownie._cli.{cmd}").main()
  File "brownie/_cli/run.py", line 38, in main
    if project.check_for_project():
  File "brownie/project/main.py", line 537, in check_for_project
    structure_config = _load_project_structure_config(folder)
  File "brownie/_config.py", line 243, in _load_project_structure_config
    data = _load_config(project_path).get("project_structure", {})
  File "brownie/_config.py", line 180, in _load_config
    return yaml.safe_load(fp)
  File "yaml/__init__.py", line 162, in safe_load
    return load(stream, SafeLoader)
  File "yaml/__init__.py", line 114, in load
    return loader.get_single_data()
  File "yaml/constructor.py", line 49, in get_single_data
    node = self.get_single_node()
  File "yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "yaml/composer.py", line 127, in compose_mapping_node
    while not self.check_event(MappingEndEvent):
  File "yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "yaml/parser.py", line 438, in parse_block_mapping_key
    raise ParserError("while parsing a block mapping", self.marks[-1],
ParserError: while parsing a block mapping
  in "/Users/zeeshanbhatti/Desktop/nftDemo/brownie-config.yaml", line 3, column 1
expected <block end>, but found '<block mapping start>'
  in "/Users/zeeshanbhatti/Desktop/nftDemo/brownie-config.yaml", line 15, column 2

Any advice and background information on what this means would be much appreciated!

7
  • So odd... did you git clone to start this? May 6 at 23:16
  • No, I was just following along with your video and looking at the git to make sure i was on the right path. Should i try to git clone it?
    – rizonpoint
    May 6 at 23:28
  • Hmmm, if you hit clone the repo you probably won’t run into the errors.... but it can also be good to code along May 7 at 2:15
  • What’s on line 15 and line 3 of your config? May 7 at 2:15
  • 1
    Maybe add dotenv: .env to the file? Perhaps you don’t have the environment variables set May 7 at 2:17
1

Add:

dotenv: .env

To your brownie-config.yaml. It’s not picking up your environment variables, and this forces brownie to pick them up out of your .env file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.