0

Brownie does not find openzeppelin contracts, even if brownie knows that it is installed

(base) andrea@andrea-ThinkPad-S430:~/MEGA/smart_contracts/demos/ERC20-brownie$ brownie pm install OpenZeppelin/[email protected]
Brownie v1.18.1 - Python development framework for Ethereum

  File "brownie/_cli/__main__.py", line 64, in main
    importlib.import_module(f"brownie._cli.{cmd}").main()
  File "brownie/_cli/pm.py", line 39, in main
    fn(*args["<arguments>"])
  File "brownie/_cli/pm.py", line 93, in _install
    package_id = project.main.install_package(uri)
  File "brownie/project/main.py", line 796, in install_package
    return _install_from_github(package_id)
  File "brownie/project/main.py", line 850, in _install_from_github
    raise FileExistsError("Package is aleady installed")
FileExistsError: Package is aleady installed

(base) andrea@andrea-ThinkPad-S430:~/MEGA/smart_contracts/demos/ERC20-brownie$ brownie compile
Brownie v1.18.1 - Python development framework for Ethereum

Compiling contracts...
  Solc version: 0.8.13
  Optimizer: Enabled  Runs: 200
  EVM Version: Istanbul
CompilerError: solc returned the following errors:

ParserError: Source "@openzeppelin/contracts/token/ERC721/ERC721.sol" not found: File not found. Searched the following locations: "".
 --> contracts/OurToken.sol:5:1:
  |
5 | import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

and the configuration is doing the remappings

dependencies:
  # - <organization/repo>@<version>
  - OpenZeppelin/[email protected] 

compiler:
  solc:
    remapping:
      - '@openzeppelin=OpenZeppelin/[email protected]'

any idea why? I have a similar problem with @chainlink

Thanks a lot

1 Answer 1

0

I think the keyword brownie config is expecting is 'remappings' not remapping. Would that solve it ?

https://eth-brownie.readthedocs.io/en/stable/config.html?#default-configuration for reference

1
  • 1
    I finally solved that issue I don't remember how but yes definitely I was missing the s in remapping. I'm still confused sometimes the github dependencies they work fine, other times I had to install them locally. Thanks :)
    – Andrea
    Commented Apr 28, 2022 at 20:10

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.