# Error compiling brownie with openzeppelin

**URL:** <https://forum.openzeppelin.com/t/error-compiling-brownie-with-openzeppelin/24433>\
**Category:** Smart Contracts\
**Created:** [February 10, 2022, 2:46pm UTC](https://forum.openzeppelin.com/t/error-compiling-brownie-with-openzeppelin/24433 "2022-02-10T14:46:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ander\_Bilba](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/ander_bilba/32/11947_2.png) [@Ander\_Bilba](https://forum.openzeppelin.com/u/Ander_Bilba)\
**Post date:** [February 10, 2022, 2:46pm UTC](https://forum.openzeppelin.com/t/error-compiling-brownie-with-openzeppelin/24433/1 "2022-02-10T14:46:05Z")

</div>

Hi,  
I have the following error when I do "brownie compile"

Invalid command. Try 'brownie --help' for available commands.  
PS C:\Users\Admin\nft project\> brownie compile  
INFO: Could not find files for the given pattern(s).  
Compiling contracts...  
Solc version: 0.6.6  
Optimizer: Enabled Runs: 200  
EVM Version: Istanbul  
CompilerError: solc returned the following errors:

contracts/simplecollectible.sol:3:1: ParserError: Source "@openzeppelin/contracts/token/ERC721/ERC721.sol" not found: \*File outside of allowed directories.  
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";  
^-------------------------------------------------------^

the code on my contract is the following:

```auto
//SPDX-Licence-Identifier:<SPDX-Licence>

pragma solidity ^0.6.6;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";

contract simplecollectibe is ERC721 {

    uint256 public tokencounter;

    constructor () ERC721("Dogie","DOG") public {

        tokencounter= 0;

    }

    function createCollectible() public returns (uint256){

        uint256 newtokenid=tokencounter;

        _safeMint(msg.sender,newtokenid);

        tokencounter= tokencounter + 1;

        return newtokenid;

    }

}

```

any suggestions on how to fix it? thanks!!

---

<div class="post-metadata">

**Author:** ![Skyge](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/skyge/32/343_2.png) [@Skyge](https://forum.openzeppelin.com/u/Skyge)\
**Post date:** [February 13, 2022, 3:02am UTC](https://forum.openzeppelin.com/t/error-compiling-brownie-with-openzeppelin/24433/2 "2022-02-13T03:02:04Z")

</div>

Hi, I think you can use this command to have a try:

```auto
brownie pm install OpenZeppelin/openzeppelin-contracts

```

---

<div class="post-metadata">

**Author:** ![Ander\_Bilba](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/ander_bilba/32/11947_2.png) [@Ander\_Bilba](https://forum.openzeppelin.com/u/Ander_Bilba)\
**Post date:** [February 13, 2022, 2:28pm UTC](https://forum.openzeppelin.com/t/error-compiling-brownie-with-openzeppelin/24433/3 "2022-02-13T14:28:22Z")

</div>

@Skyge thanks for your help. But it is still giving me the same error:

SUCCESS: Package 'OpenZeppelin/openzeppelin-contracts@3.0.0' has been installed  
PS C:\Users\Admin\nft project\> brownie compile  
Solc version: 0.6.6  
Optimizer: Enabled Runs: 200  
EVM Version: Istanbul  
CompilerError: solc returned the following errors:

contracts/simplecollectible.sol:3:1: ParserError: Source "@openzeppelin/contracts/token/ERC721/ERC721.sol" not found: File outside of allowed directories.  
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";  
^-------------------------------------------------------^

Any other ideas? thanks

---

<div class="post-metadata">

**Author:** ![Skyge](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/skyge/32/343_2.png) [@Skyge](https://forum.openzeppelin.com/u/Skyge)\
**Post date:** [February 14, 2022, 1:07am UTC](https://forum.openzeppelin.com/t/error-compiling-brownie-with-openzeppelin/24433/4 "2022-02-14T01:07:01Z")

</div>

Just read the Brownie documentation: [The Configuration File | Brownie 1.17.2](https://eth-brownie.readthedocs.io/en/stable/config.html#the-configuration-file) so it seems like you should make a new file named `brownie-config.yaml`, use the keyword `remap` to import what you will use in the package, just like:

```auto
dependencies:
  - OpenZeppelin/openzeppelin-contracts@3.0.0
compiler:
  solc:
    remappings:
      - '@openzeppelin=OpenZeppelin/openzeppelin-contracts@3.0.0'

```
