I am using brownie to deploy the mart contract. But the brownie configuration file details is not accessing in deployment.py
brownie-config.yaml
project_structure:
build: build
contracts: contracts
interfaces: interfaces
reports: reports
scripts: scripts
tests: tests
dotenv: .env
wallets:
from_key: ${PRIVATE_KEY}
networks:
default: development
development:
gas_limit: max
gas_buffer: 1
gas_price: 70
max_fee: null
priority_fee: 60
reverting_tx_gas_limit: max
default_contract_owner: true
cmd_settings: null
.env
export PRIVATE_KEY=0x<PRIVATE KEY>
deployment.py
from brownie import project, Contract, accounts, config
import brownie
myproject = project.load('/home/ubuntu/Desktop/my_contract_local')
account = accounts.add(config["wallets"]["from_key"])
print(account)
This give me the following error
KeyError: 'wallets'
Update
I am executing this file using $ python deployment.py
and not using $ brownie run deployment.py