ethereum / eth-account

Account abstraction library for web3.py
http://eth-account.readthedocs.io/
MIT License
258 stars 155 forks source link

AttributeError: module 'regex' has no attribute 'compile' #278

Closed dvvvsh closed 3 months ago

dvvvsh commented 3 months ago

not sure what I'm doing wrong but I get this,

    from eth_account import Account
  File "/Users/jonathandoe/.pyenv/versions/3.8.19/lib/python3.8/site-packages/eth_account/__init__.py", line 5, in <module>
    from eth_account.account import (
  File "/Users/jonathandoe/.pyenv/versions/3.8.19/lib/python3.8/site-packages/eth_account/account.py", line 73, in <module>
    from eth_account.messages import (
  File "/Users/jonathandoe/.pyenv/versions/3.8.19/lib/python3.8/site-packages/eth_account/messages.py", line 28, in <module>
    from eth_account._utils.encode_typed_data.encoding_and_hashing import (
  File "/Users/jonathandoe/.pyenv/versions/3.8.19/lib/python3.8/site-packages/eth_account/_utils/encode_typed_data/__init__.py", line 1, in <module>
    from .encoding_and_hashing import (
  File "/Users/jonathandoe/.pyenv/versions/3.8.19/lib/python3.8/site-packages/eth_account/_utils/encode_typed_data/encoding_and_hashing.py", line 9, in <module>
    from eth_abi import (
  File "/Users/jonathandoe/.pyenv/versions/3.8.19/lib/python3.8/site-packages/eth_abi/__init__.py", line 5, in <module>
    from eth_abi.abi import (
  File "/Users/jonathandoe/.pyenv/versions/3.8.19/lib/python3.8/site-packages/eth_abi/abi.py", line 1, in <module>
    from eth_abi.codec import (
  File "/Users/jonathandoe/.pyenv/versions/3.8.19/lib/python3.8/site-packages/eth_abi/codec.py", line 13, in <module>
    from eth_abi.decoding import (
  File "/Users/jonathandoe/.pyenv/versions/3.8.19/lib/python3.8/site-packages/eth_abi/decoding.py", line 15, in <module>
    from eth_abi.base import (
  File "/Users/jonathandoe/.pyenv/versions/3.8.19/lib/python3.8/site-packages/eth_abi/base.py", line 3, in <module>
    from .grammar import (
  File "/Users/jonathandoe/.pyenv/versions/3.8.19/lib/python3.8/site-packages/eth_abi/grammar.py", line 4, in <module>
    import parsimonious
  File "/Users/jonathandoe/.pyenv/versions/3.8.19/lib/python3.8/site-packages/parsimonious/__init__.py", line 9, in <module>
    from parsimonious.grammar import Grammar, TokenGrammar
  File "/Users/jonathandoe/.pyenv/versions/3.8.19/lib/python3.8/site-packages/parsimonious/grammar.py", line 500, in <module>
    rule_grammar = BootstrappingGrammar(rule_syntax)
  File "/Users/jonathandoe/.pyenv/versions/3.8.19/lib/python3.8/site-packages/parsimonious/grammar.py", line 66, in __init__
    exprs, first = self._expressions_from_rules(rules, decorated_custom_rules)
  File "/Users/jonathandoe/.pyenv/versions/3.8.19/lib/python3.8/site-packages/parsimonious/grammar.py", line 174, in _expressions_from_rules
    comment = Regex(r'#[^\r\n]*', name='comment')
  File "/Users/jonathandoe/.pyenv/versions/3.8.19/lib/python3.8/site-packages/parsimonious/expressions.py", line 290, in __init__
    self.re = re.compile(pattern, (ignore_case and re.I) |
AttributeError: module 'regex' has no attribute 'compile'

I have 2 lines using 'from eth_account import Account', 'acct = Account.from_key(private_key)' and 'address = acct.address'. Not sure what I'm doing wrong or what I need to do to fix this. Kind of a newb.

kclowes commented 3 months ago

This isn't a problem with the library, it looks like some sort of environment issue. Our discord is a good place to solicit help if you need it.