导入web3 python模块将导致eth\u utils中的assert keccak(“”)/加密.py

2024-04-30 03:19:51 发布

您现在位置:Python中文网/ 问答频道 /正文

导入web3python模块会导致以下assertion错误。我正在使用python3(也尝试了python2),并且安装了web3==4.0.0b6,也尝试了3.16.4eth_utils/crypto.py不开心。可能我安装了错误的版本python-sha3模块?你知道吗

Traceback (most recent call last):
  File "eth_send.py", line 1, in <module>
    import web3
  File "/Users/mimerrit/ethereum/envname/lib/python3.5/site-packages/web3/__init__.py", line 7, in <module>
    from web3.account import Account  # noqa: E402
  File "/Users/mimerrit/ethereum/envname/lib/python3.5/site-packages/web3/account.py", line 11, in <module>
    from eth_keyfile import (
  File "/Users/mimerrit/ethereum/envname/lib/python3.5/site-packages/eth_keyfile/__init__.py", line 7, in <module>
    from eth_keyfile.keyfile import (  # noqa: F401
  File "/Users/mimerrit/ethereum/envname/lib/python3.5/site-packages/eth_keyfile/keyfile.py", line 11, in <module>
    from eth_keys import keys
  File "/Users/mimerrit/ethereum/envname/lib/python3.5/site-packages/eth_keys/__init__.py", line 15, in <module>
    from .main import (  # noqa: F401
  File "/Users/mimerrit/ethereum/envname/lib/python3.5/site-packages/eth_keys/main.py", line 3, in <module>
    from eth_utils import (
  File "/Users/mimerrit/ethereum/envname/lib/python3.5/site-packages/eth_utils/__init__.py", line 5, in <module>
    from .abi import (  # noqa: F401
  File "/Users/mimerrit/ethereum/envname/lib/python3.5/site-packages/eth_utils/abi.py", line 3, in <module>
    from .crypto import keccak
  File "/Users/mimerrit/ethereum/envname/lib/python3.5/site-packages/eth_utils/crypto.py", line 18, in <module>
    assert keccak('') == b"\xc5\xd2F\x01\x86\xf7#<\x92~}\xb2\xdc\xc7\x03\xc0\xe5\x00\xb6S\xca\x82';{\xfa\xd8\x04]\x85\xa4p"  # noqa: E501
AssertionError

Tags: infrompyimportlibpackageslinesite