0

Setup:

  • Windows 10
  • Python 3.9.0
  • Brownie v1.18.1
  • Ganache CLI v6.12.2 (ganache-core 2.13.2)

I'm currently following Patrick's solidity tutorial. I'm at about 4:39:00. Here is my code and the error that is occurring: from brownie import accounts error

Is there a problem with the file init.py?

I've tried uninstalling and installing eth-brownie using the directions here. However I'm still encountering this same error.

For reference the code I am trying to run is the following:

    from brownie import accounts

def deploy_simple_storage():
    #account = accounts[0]
    #print(account)
    account = accounts.load("freecodecamp-account")
    print(account)
print("Done with deploy_simple_storage()")

def main():
    print("Hello!")
    
print("Done with deploy.py")

And the error says "cannot import name 'accounts' from 'brownie'".

Thanks for the help. Not sure what to do.

2
  • Alright, I was able to solve this by doing multiple things: pip uninstall eth-brownie, pip uninstall brownie, pip list (to check uninstalls worked), pip install brownie, pip install eth-brownie.... Then after all that I had to take out the "." from a file name so it wasn't in a file path. After doing all that it was able to run like it was supposed to. Commented Mar 2, 2022 at 16:19
  • cc : Joseph Miyaki , you took out the "." from what file name? Commented Jul 14, 2022 at 6:07

1 Answer 1

0

you're most likely getting this error because you only installed brownie-eth. Uninstall brownie eth and then run

pipx install eth-brownie 

when completed, run pip install brownie

close your terminal and restart Vscode this will work

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.