0

Hello there I'm currently following this tutorial by Patrick Collins however I'm stuck at deploy script.

PS C:\Users\aixax\Desktop\nft-from-scratch> brownie run scripts/advanced_collectible/deploy_advanced.py
INFO: Could not find files for the given pattern(s).
Brownie v1.17.1 - Python development framework for Ethereum

  File "C:\Users\aixax\AppData\Local\Programs\Python\Python310\lib\site-packages\eth_brownie-1.17.1-py3.10.egg\brownie\_cli\__main__.py", line 64, in main
    importlib.import_module(f"brownie._cli.{cmd}").main()
  File "C:\Users\aixax\AppData\Local\Programs\Python\Python310\lib\site-packages\eth_brownie-1.17.1-py3.10.egg\brownie\_cli\run.py", line 41, in main
    active_project.load_config()
  File "C:\Users\aixax\AppData\Local\Programs\Python\Python310\lib\site-packages\eth_brownie-1.17.1-py3.10.egg\brownie\project\main.py", line 453, in load_config
    _load_project_config(self._path)
  File "C:\Users\aixax\AppData\Local\Programs\Python\Python310\lib\site-packages\eth_brownie-1.17.1-py3.10.egg\brownie\_config.py", line 199, in _load_project_config
    raise ValueError(f"Dotenv specified in config but not found at path: {env_path}")  
ValueError: Dotenv specified in config but not found at path: C:\Users\aixax\Desktop\nft-from-scratch\.env

I'll inlclude my python , brownie config and .env file for the reference. The private key is my own private key with 0x at the front.

deploy_advanced.py :

from brownie import AdvancedCollectible, accounts, network, config

def main():
   dev = accounts.add(config['wallets']['from_key'])
   print(dev)

brownie-config.yaml:

dependencies: 
- OpenZeppelin/openzeppelin-contracts@3.4.0
- smartcontractkit/chainlink-brownie-contracts@1.0.2
compiler:
  solc:
    remappings:
     - '@openzeppelin=OpenZeppelin/openzeppelin-contracts@3.4.0'
     - '@chainlink=smartcontractkit/chainlink-brownie-contracts@1.0.2'
dotenv: .env
wallets:
  from_key: ${PRIVATE_KEY}
  from_mnemonic: ${MNEMONIC}

file.env:

export PRIVATE_KEY={0x___________________________________________________________}
3
  • dependencies: - OpenZeppelin/openzeppelin-contracts@3.4.0 - smartcontractkit/chainlink-brownie-contracts@1.0.2 compiler: solc: remappings: - '@openzeppelin=OpenZeppelin/openzeppelin-contracts@3.4.0' - '@chainlink=smartcontractkit/chainlink-brownie-contracts@1.0.2' dotenv: .env wallets: from_key: ${PRIVATE_KEY} from_mnemonic: ${MNEMONIC} Nov 25, 2021 at 13:33
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Nov 26, 2021 at 10:41
  • i need it to give me an output which is my address Nov 26, 2021 at 11:27

1 Answer 1

0

Your .env file is located at the wrong place.

It's expecting it to be at \Users\aixax\Desktop\nft-from-scratch\.env

You'll either need to move the file there, or update in your brownie-config.yaml where it's located at the dotenv key.

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.