0

我尝试通过 pipx、pip 和github repo安装 brownie ,但每次运行时都会出现此错误brownie

Traceback (most recent call last):
  File "/usr/bin/brownie", line 33, in <module>
    sys.exit(load_entry_point('eth-brownie==1.17.2', 'console_scripts', 'brownie')())
  File "/usr/bin/brownie", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3.9/site-packages/eth_brownie-1.17.2-py3.9.egg/brownie/__init__.py", line 6, in <module>
    from brownie.project import compile_source, run
  File "/usr/lib/python3.9/site-packages/eth_brownie-1.17.2-py3.9.egg/brownie/project/__init__.py", line 3, in <module>
    from .main import (  # NOQA 401
  File "/usr/lib/python3.9/site-packages/eth_brownie-1.17.2-py3.9.egg/brownie/project/main.py", line 45, in <module>
    from brownie.network import web3
  File "/usr/lib/python3.9/site-packages/eth_brownie-1.17.2-py3.9.egg/brownie/network/__init__.py", line 4, in <module>
    from .account import Accounts
  File "/usr/lib/python3.9/site-packages/eth_brownie-1.17.2-py3.9.egg/brownie/network/account.py", line 28, in <module>
    from brownie.convert import EthAddress, Wei, to_address
  File "/usr/lib/python3.9/site-packages/eth_brownie-1.17.2-py3.9.egg/brownie/convert/__init__.py", line 3, in <module>
    from .datatypes import EthAddress, Fixed, Wei  # NOQA: F401
  File "/usr/lib/python3.9/site-packages/eth_brownie-1.17.2-py3.9.egg/brownie/convert/datatypes.py", line 8, in <module>
    from vyper.exceptions import DecimalOverrideException
  File "/home/misterblack/.local/lib/python3.9/site-packages/vyper/__init__.py", line 1, in <module>
    from vyper.compiler import compile_code, compile_codes  # noqa: F401
  File "/home/misterblack/.local/lib/python3.9/site-packages/vyper/compiler/__init__.py", line 4, in <module>
    from vyper.compiler import output
  File "/home/misterblack/.local/lib/python3.9/site-packages/vyper/compiler/output.py", line 7, in <module>
    from vyper.ast import ast_to_dict, parse_natspec
  File "/home/misterblack/.local/lib/python3.9/site-packages/vyper/ast/__init__.py", line 19, in <module>
    from . import expansion, folding  # noqa: E402
  File "/home/misterblack/.local/lib/python3.9/site-packages/vyper/ast/folding.py", line 5, in <module>
    from vyper.builtin_functions import DISPATCH_TABLE
  File "/home/misterblack/.local/lib/python3.9/site-packages/vyper/builtin_functions/__init__.py", line 1, in <module>
    from .functions import *  # noqa: F403
  File "/home/misterblack/.local/lib/python3.9/site-packages/vyper/builtin_functions/functions.py", line 9, in <module>
    from vyper.builtin_functions.convert import convert
  File "/home/misterblack/.local/lib/python3.9/site-packages/vyper/builtin_functions/convert.py", line 6, in <module>
    from vyper.builtin_functions.signatures import signature
  File "/home/misterblack/.local/lib/python3.9/site-packages/vyper/builtin_functions/signatures.py", line 5, in <module>
    from vyper.old_codegen.expr import Expr
  File "/home/misterblack/.local/lib/python3.9/site-packages/vyper/old_codegen/expr.py", line 13, in <module>
    from vyper.old_codegen import external_call, self_call
  File "/home/misterblack/.local/lib/python3.9/site-packages/vyper/old_codegen/external_call.py", line 4, in <module>
    from vyper.old_codegen.abi import abi_encode, abi_type_of
  File "/home/misterblack/.local/lib/python3.9/site-packages/vyper/old_codegen/abi.py", line 4, in <module>
    from vyper.old_codegen.parser_utils import (
  File "/home/misterblack/.local/lib/python3.9/site-packages/vyper/old_codegen/parser_utils.py", line 42, in <module>
    setcontext(DecimalContextOverride(prec=78))
  File "/usr/lib/python3.9/_pydecimal.py", line 3898, in __init__
    self.prec = prec if prec is not None else dc.prec
  File "/home/misterblack/.local/lib/python3.9/site-packages/vyper/old_codegen/parser_utils.py", line 38, in __setattr__
    raise DecimalOverrideException("Overriding decimal precision disabled")
vyper.exceptions.DecimalOverrideException: <exception str() failed>

任何有关解决此问题的帮助将不胜感激。

4

1 回答 1

0

我终于设法解决了这个问题。我发现错误是由于 vyper 造成的,vyper --version也给出了类似的错误。所以,我去了最后一个异常:

 File "/home/misterblack/.local/lib/python3.9/site-packages/vyper/old_codegen/parser_utils.py", line 38, in __setattr__
    raise DecimalOverrideException("Overriding decimal precision disabled")

并打开提到的文件..../vyper/old_codegen/parser_utils.py,并注释了引发异常的行。 注释代码的图像。这完全消除了错误,可以在这里看到。我不知道这是否是最好的方法,但它似乎正在工作。 成功!

于 2021-12-15T17:30:32.107 回答