blockchain-etl / ethereum-etl

Python scripts for ETL (extract, transform and load) jobs for Ethereum blocks, transactions, ERC20 / ERC721 tokens, transfers, receipts, logs, contracts, internal transactions. Data is available in Google BigQuery https://goo.gl/oY5BCQ
https://t.me/BlockchainETL
MIT License
2.93k stars 840 forks source link

ImportError: cannot import name 'getargspec' from 'inspect' (/usr/lib/python3.12/inspect.py). Did you mean: 'getargs'? #494

Open adeelmalik1988 opened 1 month ago

adeelmalik1988 commented 1 month ago

I am using EC2 AWS instance in which I am using python env. I installed with pip3 install ethereum-etl. I'm unable to run any ethereumetl cmd due to b/m error. Please guide how to resolve this error as I'm stuck for hours now:

(eth-etl-env) ubuntu@ip-172-31-29-202:~/ethereum-etl$ ethereumetl export_blocks_and_transactions --start-block 0 --end-block 500000 --blocks-output blocks.csv --transactions-output transactions.csv --provider-uri https://mainnet.infura.io/v3/7aef3f0cd1f64408b163814b22cc643c
Traceback (most recent call last):
  File "/home/ubuntu/ethereum-etl/eth-etl-env/bin/ethereumetl", line 5, in <module>
    from ethereumetl.cli import cli
  File "/home/ubuntu/ethereum-etl/ethereumetl/cli/__init__.py", line 28, in <module>
    from ethereumetl.cli.export_all import export_all
  File "/home/ubuntu/ethereum-etl/ethereumetl/cli/export_all.py", line 30, in <module>
    from ethereumetl.web3_utils import build_web3
  File "/home/ubuntu/ethereum-etl/ethereumetl/web3_utils.py", line 23, in <module>
    from web3 import Web3
  File "/home/ubuntu/ethereum-etl/eth-etl-env/lib/python3.12/site-packages/web3-5.31.4-py3.12.egg/web3/__init__.py", line 6, in <module>
    from eth_account import (
  File "/home/ubuntu/ethereum-etl/eth-etl-env/lib/python3.12/site-packages/eth_account-0.5.9-py3.12.egg/eth_account/__init__.py", line 1, in <module>
    from eth_account.account import (
  File "/home/ubuntu/ethereum-etl/eth-etl-env/lib/python3.12/site-packages/eth_account-0.5.9-py3.12.egg/eth_account/account.py", line 59, in <module>
    from eth_account.messages import (
  File "/home/ubuntu/ethereum-etl/eth-etl-env/lib/python3.12/site-packages/eth_account-0.5.9-py3.12.egg/eth_account/messages.py", line 26, in <module>
    from eth_account._utils.structured_data.hashing import (
  File "/home/ubuntu/ethereum-etl/eth-etl-env/lib/python3.12/site-packages/eth_account-0.5.9-py3.12.egg/eth_account/_utils/structured_data/hashing.py", line 9, in <module>
    from eth_abi import (
  File "/home/ubuntu/ethereum-etl/eth-etl-env/lib/python3.12/site-packages/eth_abi-2.2.0-py3.12.egg/eth_abi/__init__.py", line 6, in <module>
    from eth_abi.abi import (  # NOQA
  File "/home/ubuntu/ethereum-etl/eth-etl-env/lib/python3.12/site-packages/eth_abi-2.2.0-py3.12.egg/eth_abi/abi.py", line 1, in <module>
    from eth_abi.codec import (
  File "/home/ubuntu/ethereum-etl/eth-etl-env/lib/python3.12/site-packages/eth_abi-2.2.0-py3.12.egg/eth_abi/codec.py", line 16, in <module>
    from eth_abi.decoding import (
  File "/home/ubuntu/ethereum-etl/eth-etl-env/lib/python3.12/site-packages/eth_abi-2.2.0-py3.12.egg/eth_abi/decoding.py", line 14, in <module>
    from eth_abi.base import (
  File "/home/ubuntu/ethereum-etl/eth-etl-env/lib/python3.12/site-packages/eth_abi-2.2.0-py3.12.egg/eth_abi/base.py", line 7, in <module>
    from .grammar import (
  File "/home/ubuntu/ethereum-etl/eth-etl-env/lib/python3.12/site-packages/eth_abi-2.2.0-py3.12.egg/eth_abi/grammar.py", line 4, in <module>
    import parsimonious
  File "/home/ubuntu/ethereum-etl/eth-etl-env/lib/python3.12/site-packages/parsimonious-0.8.1-py3.12.egg/parsimonious/__init__.py", line 9, in <module>
  File "/home/ubuntu/ethereum-etl/eth-etl-env/lib/python3.12/site-packages/parsimonious-0.8.1-py3.12.egg/parsimonious/grammar.py", line 14, in <module>
  File "/home/ubuntu/ethereum-etl/eth-etl-env/lib/python3.12/site-packages/parsimonious-0.8.1-py3.12.egg/parsimonious/expressions.py", line 9, in <module>
ImportError: cannot import name 'getargspec' from 'inspect' (/usr/lib/python3.12/inspect.py). Did you mean: 'getargs'?

pip3 list

ackage                   Version     Editable project location
------------------------- ----------- -------------------------
aiohappyeyeballs          2.3.5
aiohappyeyeballs          2.3.5
aiohttp                   3.10.2
aiohttp                   3.10.2
aiosignal                 1.3.1
aiosignal                 1.3.1
attrs                     24.2.0
attrs                     24.2.0
base58                    2.1.1
base58                    2.1.1
bitarray                  2.9.2
bitarray                  2.9.2
certifi                   2024.7.4
certifi                   2024.7.4
charset-normalizer        3.3.2
charset-normalizer        3.3.2
click                     8.1.7
click                     8.1.7
colorama                  0.4.6
colorama                  0.4.6
Cython                    3.0.11
cytoolz                   0.12.3
cytoolz                   0.12.3
eth-abi                   2.2.0
eth-abi                   2.2.0
eth-account               0.5.9
eth-account               0.5.9
eth-hash                  0.3.3
eth-hash                  0.3.3
eth-keyfile               0.5.1
eth-keyfile               0.5.1
eth-keys                  0.3.4
eth-keys                  0.3.4
eth-rlp                   0.2.1
eth-rlp                   0.2.1
eth-typing                2.3.0
eth-typing                2.3.0
eth-utils                 1.10.0
eth-utils                 1.10.0
ethereum-dasm             0.1.4
ethereum-dasm             0.1.4
ethereum-etl              2.4.2       /home/ubuntu/ethereum-etl
evmdasm                   0.1.10
evmdasm                   0.1.10
frozenlist                1.4.1
frozenlist                1.4.1
hexbytes                  0.3.1
hexbytes                  0.3.1
idna                      3.7
idna                      3.7
ipfshttpclient            0.8.0a2
ipfshttpclient            0.8.0a2
jsonschema                4.23.0
jsonschema                4.23.0
jsonschema-specifications 2023.12.1
jsonschema-specifications 2023.12.1
lru-dict                  1.3.0
lru-dict                  1.3.0
multiaddr                 0.0.9
multiaddr                 0.0.9
multidict                 6.0.5
multidict                 6.0.5
netaddr                   1.3.0
netaddr                   1.3.0
parsimonious              0.8.1
parsimonious              0.8.1
parsimonious              0.8.1
pip                       24.0
protobuf                  3.19.5
protobuf                  3.19.5
pycryptodome              3.20.0
pycryptodome              3.20.0
python-dateutil           2.9.0.post0
python-dateutil           2.9.0.post0
referencing               0.35.1
referencing               0.35.1
requests                  2.32.3
requests                  2.32.3
rlp                       2.0.1
rlp                       2.0.1
rpds-py                   0.20.0
rpds-py                   0.20.0
setuptools                72.1.0
six                       1.16.0
six                       1.16.0
tabulate                  0.9.0
tabulate                  0.9.0
toolz                     0.12.1
toolz                     0.12.1
urllib3                   1.26.19
urllib3                   1.26.19
varint                    1.0.2
varint                    1.0.2
varint                    1.0.2
web3                      5.31.4
web3                      5.31.4
websockets                9.1
websockets                9.1
yarl                      1.9.4
yarl                      1.9.4

env

(eth-etl-env) ubuntu@ip-172-31-29-202:~/ethereum-etl$ ls eth-etl-env/bin/
Activate.ps1  activate.csh   base58  cython     ethereumetl  netaddr     pip   pip3.12  python3     tabulate
activate      activate.fish  cygdb   cythonize  jsonschema   normalizer  pip3  python   python3.12
nguyenphihugn commented 1 month ago

you can go to site-packages/parsimonious/expressions.py in your python env and change import line form "getargspec" to "getfullargspec"

murat1999 commented 1 month ago

I resolved this issue by simply installing Python 3.10.x version. It seems Python versions > 3.11 are not working properly. So just installing the older version and running in the virtual environment works fine.

adeelmalik1988 commented 1 month ago

Thank you guys for your responses. I have tried b/m and it works. import line form "getargspec" to "getfullargspec" It is also good to know that Python 3.10.x versions work fine.

On Mon, Aug 19, 2024 at 8:32 AM Murat Baktur @.***> wrote:

I resolved this issue by simply installing Python 3.10.x version. It seems Python versions > 3.11 are not working properly. So just installing the older version and running in the virtual environment works fine.

— Reply to this email directly, view it on GitHub https://github.com/blockchain-etl/ethereum-etl/issues/494#issuecomment-2295599836, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOQFFV5VJEJKIMLHQOQBOX3ZSFRL3AVCNFSM6AAAAABMIMLEZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJVGU4TSOBTGY . You are receiving this because you authored the thread.Message ID: @.***>

-- Sincere Regards

Adeel MalikTCC-21