我用Anaconda在我的系统(Windows)上安装了python,这可能是问题的根本原因。我正处于一个需要运行deploy.py脚本来部署契约的阶段,但是文件无法找到,什么也没有发生。
每次我运行brownie时,我都会首先得到一条信息:
INFO: Could not find files for the given pattern(s).然后,Brownie运行,编译合同等,我得到了大量与ganache文件相关的文本。最后,我得到一个FileNotFoundError,表示系统找不到我想要运行的文件。代码如下:
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发布于 2021-07-14 23:51:46
发布于 2021-10-03 15:04:12
在Windows20H2上,我也面临着同样的问题,我尝试使用npm install -g ganache-cli,但多次卸载和重新安装都不起作用。在那之后,我检查了我的节点版本,它是12.xx,这就是问题所在。我把它升级到14.18.0,现在布朗尼为我工作。https://nodejs.org/en/
发布于 2022-01-18 22:44:52
当我打字快的时候,我会留下空白。
brownie run scripts /fileName.py它应该是
brownie run scripts/fileName.pyhttps://ethereum.stackexchange.com/questions/103489
复制相似问题