Brownie v1.15.1 - Python development framework for Ethereum

  File "brownie/_cli/__main__.py", line 64, in main
  File "brownie/_cli/run.py", line 43, in main
  File "brownie/network/main.py", line 40, in connect
    web3.connect(host, active.get("timeout", 30))
  File "brownie/network/web3.py", line 52, in connect
    uri = _expand_environment_vars(uri)
  File "brownie/network/web3.py", line 183, in _expand_environment_vars
    raise ValueError(f"Unable to expand environment variable in host setting: '{uri}'")
ValueError: Unable to expand environment variable in host setting: 'https://rinkeby.infura.io/v3/$WEB3_INFURA_PROJECT_ID'
  • Can you please add what your .env file looks like (WITHOUT having any actual keys), and your brownie-config.yaml as well as the script you ran? Commented Aug 5, 2021 at 16:02
  • this is my broniw-config.yaml, is the same as your code on the NFT/ERC-721/Collectible END-TO-END TUTORIAL | Deploy, List on Opensea, Host Metadata on IPFS reports: exclude_contracts: - SafeMath dependencies: - smartcontractkit/[email protected] - OpenZeppelin/[email protected] compiler: solc: remappings: - '@chainlink=smartcontractkit/[email protected]' - '@openzeppelin=OpenZeppelin/[email protected]' autofetch_sources: dotenv: .env from_key: ${PRIVATE_KEY} from_mnemonic: ${MNEMONIC}
    – Fran ETH
    Commented Aug 5, 2021 at 17:33

2 Answers 2


I ran into this issue as well and what worked for me was adding dotenv: .env on the brownie-config.yaml file.


After adding this line to .env file:

export WEB3_INFURA_PROJECT_ID='3fcea.....'

Type in your terminal the following line:


It worked for me :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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