Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
adeelmalik1988 opened this issue Aug 9, 2024 · 3 comments

Comments

@adeelmalik1988
Copy link

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
Copy link

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

@murat1999
Copy link

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
Copy link
Author

adeelmalik1988 commented Aug 19, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants