1

PS E:\NFT-DEMO> brownie run scripts/deploy_and_create.py --network rinkeby INFO: Could not find files for the given pattern(s). Brownie v1.16.4 - Python development framework for Ethereum

NftDemoProject is the active project. File "C:\Users\scs\AppData\Local\Programs\Python\Python310\lib\site-packages\brownie_cli_main_.py", line 64, in main importlib.import_module(f"brownie._cli.{cmd}").main() network.connect(CONFIG.argv["network"]) File "C:\Users\scs\AppData\Local\Programs\Python\Python310\lib\site-packages\brownie\network\main.py", line 40, in connect web3.connect(host, active.get("timeout", 30)) File "C:\Users\scs\AppData\Local\Programs\Python\Python310\lib\site-packages\brownie\network\web3.py", line 52, in connect uri = _expand_environment_vars(uri) File "C:\Users\scs\AppData\Local\Programs\Python\Python310\lib\site-packages\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'

2 Answers 2

1

This states that you have not set the environment variable. Using brownie you can easily do that by creating a file named .env inside the brownie project and there you can export your variable as

export WEB3_INFURA_PROJECT_ID=XXXXXXXXXXXXXX

Now brownie will place this variable to get the infura instance

16
  • yes i have did it
    – Kamal Shah
    Dec 8, 2021 at 12:48
  • but still iam getting the same error
    – Kamal Shah
    Dec 8, 2021 at 12:48
  • Do you have brownie-config.yaml file? Dec 8, 2021 at 12:51
  • If you don't then create it and make sure have this content in it dotenv: .env Dec 8, 2021 at 12:53
  • yes i have made a .env file and I put my private key and infura project id in it but still the same error persist
    – Kamal Shah
    Dec 8, 2021 at 13:47
0
Unable to expand environment variable in host setting: 'https://rinkeby.infura.io/v3/$WEB3_INFURA_PROJECT_ID'

This is your error.

It says you have not set the environment variable.

You must set the environment variable.

1
  • how to set environment variable
    – Kamal Shah
    Dec 8, 2021 at 12:16

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.