pipethereumsoliditybrowniepipx

Eth-Brownie Installation error: Tried all 3 methods [linux]


I tried installing brownie via pipx, pip and the github repo , but each time I get this error on running 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>

Any help on fixing this would be appreciated.


Solution

  • I finally managed to solve this. I figured out that the error was due to vyper, as vyper --version also gave a similar error. So, I went to the last exception raised:

     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")
    

    and opened the file mentioned ..../vyper/old_codegen/parser_utils.py, and commented the lines that were throwing the exception. Image of the commented code. This completely removed the error, as can be seen here. I don't know if it's the best approach, but it seems to be working. Success!