3

I have python installed on my system (Windows) with Anaconda from a prior course I had taken which may be the root cause of the issue. I'm at the stage where I need to run a deploy.py script to deploy the contract but the file cannot be found and nothing happens.

Every time I run brownie I first get an informational note:

INFO: Could not find files for the given pattern(s).

Then, Brownie runs, compiles the contracts etc. and I get a ton of text having to do with ganache files. Finally, I get a FileNotFoundError saying the system can't find the file I want to run. Code below:

PS C:\Users\nstei\Git Repos\my-frist-brownie-project> brownie run .\scripts\deploy.py
INFO: Could not find files for the given pattern(s).  
Brownie v1.14.6 - Python development framework for Ethereum

Compiling contracts...  
  Solc version: 0.7.3  
  Optimizer: Enabled  Runs: 200  
  EVM Version: Istanbul  
Generating build data...  
 - MyFirstContract  

MyFristBrownieProject is the active project.

Launching 'ganache-cli.cmd --port 8545 --gasLimit 12000000 --accounts 10 --hardfork istanbul --mnemonic brownie'...  
  File "c:\users\nstei\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\_cli\__main__.py", line 64, in main  
    importlib.import_module(f"brownie._cli.{cmd}").main()  
  File "c:\users\nstei\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\_cli\run.py", line 43, in main
    network.connect(CONFIG.argv["network"])  
  File "c:\users\nstei\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\main.py", line 50, in connect
    rpc.launch(active["cmd"], **active["cmd_settings"])  
  File "c:\users\nstei\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\rpc\__init__.py", line 77, in launch
    self.process = self.backend.launch(cmd, **kwargs)  
  File "c:\users\nstei\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\rpc\ganache.py", line 73, in launch
    return psutil.Popen(cmd_list, stdin=DEVNULL, stdout=out, stderr=out)  
  File "c:\users\nstei\.local\pipx\venvs\eth-brownie\lib\site-packages\psutil\__init__.py", line 1312, in __init__
    self.__subproc = subprocess.Popen(*args, **kwargs)  
  File "C:\Python39\lib\subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,  
  File "C:\Python39\lib\subprocess.py", line 1420, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,  
FileNotFoundError: [WinError 2] The system cannot find the file specified
1
  • Can you try changing brownie run .\scripts\deploy.py -> brownie run scripts\deploy.py Commented Jul 14, 2021 at 23:41

3 Answers 3

4

It's having a hard time finding ganache. You'll need nodejs and npm installed, and then run the following:

npm install -g ganache-cli

And you should be good to go

1
  • 1
    I had the definitely same issue with @Nicks, but this solution helped me. Thanks!
    – Bi Wu
    Commented Oct 11, 2021 at 0:46
2

I was facing the same issue on Windows 20H2, I tried to use npm install -g ganache-cli But did not work for me uninstalled and reinstalled many times. After that, I've checked my node version which was 12.xx and it was the problem. I've upgraded it to 14.18.0 and now the brownie works for me. https://nodejs.org/en/

0

It happens to me when I type fast, I leave blank

  brownie run scripts /fileName.py

It should be

brownie run scripts/fileName.py

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.