I am getting an error from brownie compile and I can't figure out why it wont import one of the openzeppelin contracts when all the others import ok. here is my brownie-config.yaml

# https://eth-brownie.readthedocs.io/en/v1.10.3/config.html#exclude_paths
    - SafeMath
  # - smartcontractkit/[email protected]
  - OpenZeppelin/[email protected]
      # - '@chainlink=smartcontractkit/[email protected]'
      - '@openzeppelin=OpenZeppelin/[email protected]'

And the code that is causing the issue:

// SPDX-License-Identifier: MIT
// Creator: Chiru Labs

pragma solidity >=0.8.12;

import '@openzeppelin/contracts/token/ERC721/IERC721.sol';

and the results from brownie compile:

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

ParserError: Source "/home/tonyr/.brownie/packages/OpenZeppelin/[email protected]/openzeppelin-contracts/token/ERC721/IERC721.sol" not found: File not found. Searched the following locations: "".
 --> contracts/ERC721A.sol:6:1:
6 | import '@openzeppelin/openzeppelin-contracts/token/ERC721/IERC721.sol';
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I'm at a loss as to why this one contract wont import when all the others seem to be ok?

  • There is something I don't understand, your error message doesn't match your source code: import '@openzeppelin/openzeppelin-contracts/token/ERC721/IERC721.sol'; is different from import '@openzeppelin/contracts/token/ERC721/IERC721.sol'; Also in error message openzepellin version doesn't match the one in your configuration file: 4.4.1 & 4.5.0 Commented Mar 21, 2022 at 10:28
  • I dont understand it either tbh...but its working now so I will close the question
    – Tony
    Commented Mar 22, 2022 at 13:28

1 Answer 1


This is working now, without any changes. I dont have an explanation

  • The explanation is that you didn't delete your build folder... I nuked my system twice without realizing that is what causes this. Sometimes it gets corrupted.
    – ctnava
    Commented Mar 22, 2022 at 14:47

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.