Python Forum

Full Version: ValueError in dataclasses.py - using staking-deposit-cli
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
My project uses https://github.com/ethereum/staking-depo...y_handling

When trying execute it, I get the following:

Error:
Running deposit-cli... Traceback (most recent call last): File "/blockchain/staking-deposit-cli/./staking_deposit/deposit.py", line 4, in <module> from staking_deposit.cli.existing_mnemonic import existing_mnemonic File "/blockchain/staking-deposit-cli/venv/lib/python3.11/site-packages/staking_deposit/cli/existing_mnemonic.py", line 19, in <module> from staking_deposit.utils.validation import validate_int_range File "/blockchain/staking-deposit-cli/venv/lib/python3.11/site-packages/staking_deposit/utils/validation.py", line 24, in <module> from staking_deposit.credentials import ( File "/blockchain/staking-deposit-cli/venv/lib/python3.11/site-packages/staking_deposit/credentials.py", line 14, in <module> from staking_deposit.key_handling.keystore import ( File "/blockchain/staking-deposit-cli/venv/lib/python3.11/site-packages/staking_deposit/key_handling/keystore.py", line 62, in <module> @dataclass ^^^^^^^^^ File "/usr/lib/python3.11/dataclasses.py", line 1220, in dataclass return wrap(cls) ^^^^^^^^^ File "/usr/lib/python3.11/dataclasses.py", line 1210, in wrap return _process_class(cls, init, repr, eq, order, unsafe_hash, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/dataclasses.py", line 958, in _process_class cls_fields.append(_get_field(cls, name, type, kw_only)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/dataclasses.py", line 815, in _get_field raise ValueError(f'mutable default {type(f.default)} for field ' ValueError: mutable default <class 'staking_deposit.key_handling.keystore.KeystoreModule'> for field kdf is not allowed: use default_factory
I'm using Python 3.11.2 on a Raspberry PI 5.
Any idea how to fix this? Am I missing packages?