brownie-mix / aave-flashloan-mix

A Brownie mix containing all you need to get started with developing flash loans
GNU Affero General Public License v3.0
399 stars 275 forks source link

Error when I run the get WETH command: brownie run scripts/get_weth.py --network kovan #20

Closed AshrafAKRahman closed 2 years ago

AshrafAKRahman commented 2 years ago

After setting up the environment and when I run the get WETH command: brownie run scripts/get_weth.py --network kovan i get the following error: INFO: Could not find files for the given pattern(s). Brownie v1.17.2 - Python development framework for Ethereum

File "..local\pipx\venvs\eth-brownie\lib\site-packages\brownie_cli__main__.py", line 64, in main importlib.import_module(f"brownie._cli.{cmd}").main() File "..local\pipx\venvs\eth-brownie\lib\site-packages\brownie_cli\run.py", line 44, in main network.connect(CONFIG.argv["network"]) File "..local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\main.py", line 40, in connect web3.connect(host, active.get("timeout", 30)) File "..local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\web3.py", line 52, in connect uri = _expand_environment_vars(uri) File "..local\pipx\venvs\eth-brownie\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://kovan.infura.io/v3/$WEB3_INFURA_PROJECT_ID'
PS C:\Users\Ash> brownie run scripts/run_flash_loan_v2.py --network kovan INFO: Could not find files for the given pattern(s). Brownie v1.17.2 - Python development framework for Ethereum

File "..local\pipx\venvs\eth-brownie\lib\site-packages\brownie_cli__main.py", line 64, in main importlib.import_module(f"brownie._cli.{cmd}").main()
File "..local\pipx\venvs\eth-brownie\lib\site-packages\brownie_cli\run.py", line 44, in main network.connect(CONFIG.argv["network"]) File "..local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\main.py", line 40, in connect web3.connect(host, active.get("timeout", 30)) File "..local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\web3.py", line 52, in connect uri = _expand_environment_vars(uri) File "..local\pipx\venvs\eth-brownie\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}'") rownie_cli\
main__.py", line 64, in main importlib.import_module(f"brownie._cli.{cmd}").main() File "..local\pipx\venvs\eth-brownie\lib\site-packages\brownie_cli\run.py", line 44, in main network.connect(CONFIG.argv["network"]) File "..local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\main.py", line 40, in connect web3.connect(host, active.get("timeout", 30)) File "..local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\web3.py", line 52, in connect uri = _expand_environment_vars(uri) File "..local\pipx\venvs\eth-brownie\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://kovan.infura.io/v3/$WEB3_INFURA_PROJECT_ID' PS C:\Users\Ash> brownie --version INFO: Could not find files for the given pattern(s). Brownie v1.17.2 - Python development framework for Ethereum

lit26 commented 2 years ago

Try source .env in the terminal to load your .env file

AshrafAKRahman commented 2 years ago

But running this it will expose all my private keys (api etc) so I am a little hesitant to run that on the terminal

PatrickAlphaC commented 2 years ago

This is a common error. Do either of these answer your question?

https://stackoverflow.com/questions/70668428/brownie-rinkeby-unable-to-expand-environment-variable-in-host-setting/70717346#70717346

https://ethereum.stackexchange.com/questions/102807/eth-brownie-unable-to-expand-environment-variable-in-host-setting

You have an issue with your .env file and brownie-config.yaml.