当我尝试使用以下 PowerShell 命令运行带有 brownie 的脚本时,出现以下错误;
brownie run scripts/simple_collectible/deploy_simple
我已经查看了所有堆叠的页面和其他页面以获取有关此信息的信息,但我似乎找不到太多,我真的很想继续我的项目,但我被困在这一点上。任何 hekp 都会很棒。
干杯!
信息消息:
PS C:\Users\charl\OneDrive\Desktop\NFT Development\NFT-mix-main> brownie run scripts/simple_collectible/deploy_simple
INFO:找不到给定模式的文件。Brownie v1.17.2 - 以太坊的 Python 开发框架
NftMixMainProject 是活动项目。
启动 'ganache-cli.cmd --port 8545 --gasLimit 12000000 --accounts 10 --hardfork istanbul --mnemonic brownie'... 文件 "C:\Users\charl.local\pipx\venvs\eth-brownie\ lib\site-packages\brownie_cli_ main _.py",第 64 行,在 main importlib.import_module(f"brownie._cli.{cmd}").main() 文件“C:\Users\charl.local\pipx\ venvs\eth-brownie\lib\site-packages\brownie_cli\run.py",第 46 行,在主路径中,_ = _get_path(args[""]) 文件“C:\Users\charl.local\pipx\venvs \eth-brownie\lib\site-packages\brownie\project\scripts.py",第 130 行,在 _get_path 中引发 FileNotFoundError(f"Cannot find {path_str}") FileNotFoundError: Cannot find scripts/simple_collectible/deploy_simple 终止本地 RPC 客户端...
我安装了以下软件包:
- ganache-cli
- 点子
- 像素
- 布朗尼(通过 pipx 安装,并初始化)
- 我已经运行了 brownie 命令以确保安装良好。
- 我已经安装了 Python Venv
- 我已经尝试卸载所有打包并重新安装
- 我对我的 VScode 和 Vsbuildtools 做了同样的事情
- 我对 Python 本身也做了同样的事情(从网站重新安装)
我尝试运行的脚本的代码片段在这里:
#!/usr/bin/python3
import os
from brownie import SimpleCollectible, accounts, config, network
def main():
dev = accounts.add(config["wallets"]["from_key"])
print(network.show_active())
publish_source = True if os.getenv("ETHERSCAN_TOKEN") else False
SimpleCollectible.deploy({"from": dev}, publish_source=publish_source)
最后供您参考,我在这里有我的 brownie-config.yaml 内容:
# exclude SafeMath when calculating test coverage
# https://eth-brownie.readthedocs.io/en/v1.10.3/config.html#exclude_paths
reports:
exclude_contracts:
- SafeMath
dependencies:
- smartcontractkit/chainlink-brownie-contracts@1.1.1
- OpenZeppelin/openzeppelin-contracts@3.4.0
compiler:
solc:
remappings:
- '@chainlink=smartcontractkit/chainlink-brownie-contracts@1.1.1'
- '@openzeppelin=OpenZeppelin/openzeppelin-contracts@3.4.0'
# automatically fetch contract sources from Etherscan
autofetch_sources: True
dotenv: .env
# set a custom mnemonic for the development network
networks:
default: development
kovan:
vrf_coordinator: '0xdD3782915140c8f3b190B5D67eAc6dc5760C46E9'
link_token: '0xa36085F69e2889c224210F603D836748e7dC0088'
keyhash: '0x6c3699283bda56ad74f6b855546325b68d482e983852a7a82979cc4807b641f4'
fee: 100000000000000000
oracle: '0x2f90A6D021db21e1B2A077c5a37B3C7E75D15b7e'
jobId: '29fa9aa13bf1468788b7cc4a500a45b8'
eth_usd_price_feed: '0x9326BFA02ADD2366b30bacB125260Af641031331'
rinkeby:
vrf_coordinator: '0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B'
link_token: '0x01be23585060835e02b77ef475b0cc51aa1e0709'
keyhash: '0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311'
fee: 100000000000000000
oracle: '0x7AFe1118Ea78C1eae84ca8feE5C65Bc76CcF879e'
jobId: '6d1bfe27e7034b1d87b5270556b17277'
eth_usd_price_feed: '0x8A753747A1Fa494EC906cE90E9f37563A8AF630e'
mumbai:
eth_usd_price_feed: '0x0715A7794a1dc8e42615F059dD6e406A6594651A'
binance:
# link_token: ??
eth_usd_price_feed: '0x9ef1B8c0E4F7dc8bF5719Ea496883DC6401d5b2e'
binance-fork:
eth_usd_price_feed: '0x9ef1B8c0E4F7dc8bF5719Ea496883DC6401d5b2e'
mainnet-fork:
eth_usd_price_feed: '0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419'
matic-fork:
eth_usd_price_feed: '0xF9680D99D6C9589e2a93a78A04A279e509205945'
wallets:
from_key: ${PRIVATE_KEY}
from_mnemonic: ${MNEMONIC}
# You'd have to change the accounts.add to accounts.from_mnemonic to use from_mnemonic