'can't import module from solidity file to python file in brownie; ImportError: cannot import name 'AdvancedCollectible' from 'brownie'

I'm trying to build out this tutorial, but I keep getting the same error when I try to import from a solidity file to a python script and run it, all in the same environment via brownie.

I'm using this command in my local terminal: 'brownie run scripts/advanced_collectible/deploy_advanced.py'

And I keep getting this error: ImportError: cannot import name 'AdvancedCollectible' from 'brownie'

The solidity contract function is called AdvancedCollectible and it is in a file located at build/contracts/AdvancedCollectible.sol in the same local directory.

The python script calls "from brownie import AdvancedCollectible"

Everything is spelled correctly in both files, so I'm not sure what the issue is. Anyone have a solve?



Solution 1:[1]

from brownie import "must_be_contract_name not solidity file_name"

for example: AdvancedCollectible.sol

contract ContractName {

}

from brownie import ContractName

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ali S?tk? Aslanta?