Swapnil
Swapnil

Reputation: 124

ImportError: cannot import name 'getargspec' from 'inspect' (C:\Users\Swapn\AppData\Local\Programs\Python\Python311\Lib\inspect.py)

 File "f:\drug-traceability-blockchain-maddy\src\app.py", line 2, in <module>
    from web3 import Web3,HTTPProvider
  File "C:\Users\Swapn\AppData\Local\Programs\Python\Python311\Lib\site-packages\web3\__init__.py", line 6, in <module>
    from eth_account import (
  File "C:\Users\Swapn\AppData\Local\Programs\Python\Python311\Lib\site-packages\eth_account\__init__.py", line 1, in <module>
    from eth_account.account import (
  File "C:\Users\Swapn\AppData\Local\Programs\Python\Python311\Lib\site-packages\eth_account\account.py", line 59, in <module>
    from eth_account.messages import (
  File "C:\Users\Swapn\AppData\Local\Programs\Python\Python311\Lib\site-packages\eth_account\messages.py", line 26, in <module>
    from eth_account._utils.structured_data.hashing import (
  File "C:\Users\Swapn\AppData\Local\Programs\Python\Python311\Lib\site-packages\eth_account\_utils\structured_data\hashing.py", line 9, in <module>
    from eth_abi import (
  File "C:\Users\Swapn\AppData\Local\Programs\Python\Python311\Lib\site-packages\eth_abi\__init__.py", line 6, in <module>
    from eth_abi.abi import (  # NOQA
  File "C:\Users\Swapn\AppData\Local\Programs\Python\Python311\Lib\site-packages\eth_abi\abi.py", line 1, in <module>
    from eth_abi.codec import (
  File "C:\Users\Swapn\AppData\Local\Programs\Python\Python311\Lib\site-packages\eth_abi\codec.py", line 16, in <module>
    from eth_abi.decoding import (
  File "C:\Users\Swapn\AppData\Local\Programs\Python\Python311\Lib\site-packages\eth_abi\decoding.py", line 14, in <module>
    from eth_abi.base import (
  File "C:\Users\Swapn\AppData\Local\Programs\Python\Python311\Lib\site-packages\eth_abi\base.py", line 7, in <module>
    from .grammar import (
  File "C:\Users\Swapn\AppData\Local\Programs\Python\Python311\Lib\site-packages\eth_abi\grammar.py", line 4, in <module>
    import parsimonious
  File "C:\Users\Swapn\AppData\Local\Programs\Python\Python311\Lib\site-packages\parsimonious\__init__.py", line 9, in <module>
    from parsimonious.grammar import Grammar, TokenGrammar
  File "C:\Users\Swapn\AppData\Local\Programs\Python\Python311\Lib\site-packages\parsimonious\grammar.py", line 14, in <module>
    from parsimonious.expressions import (Literal, Regex, Sequence, OneOf,
  File "C:\Users\Swapn\AppData\Local\Programs\Python\Python311\Lib\site-packages\parsimonious\expressions.py", line 9, in <module>
    from inspect import getargspec
ImportError: cannot import name 'getargspec' from 'inspect' (C:\Users\Swapn\AppData\Local\Programs\Python\Python311\Lib\inspect.py)   

please help me .. how to solve this error. this is blockchain project wgich i downloaded from github. after that i was npm install npm start truffle complile truffle migrate and for homepage of project run app.py then i was receive this error.Image of running errors

Upvotes: 6

Views: 20960

Answers (4)

Daniel Stern
Daniel Stern

Reputation: 1

If you encounter this error while building a docker container (and thus editing the package manually is not an option), this might work.

Change the first line from

FROM python:3.11.5 # or whatever version you were using

to

FROM python:3.10.7

Upvotes: 0

Shirshak kandel
Shirshak kandel

Reputation: 609

If you installed web3.py through pip, it still won't work while the update is being approved it still install old version. Run pip uninstall web3 to uninstall the old version, and run pip install git+https://github.com/ethereum/web3.py.git to install the new version off GitHub.

Upvotes: 1

Harish Selvaraj
Harish Selvaraj

Reputation: 66

Try uninstalling web3 using pip uninstall web3.py and install the latest version from github using pip install git+https://github.com/ethereum/web3.py.git

Upvotes: 5

Arnab Chakraborty
Arnab Chakraborty

Reputation: 61

Either depreciate python

or go to python3.11/site-packages/parsimonious/expressions.py and replace getargspec with getfullargspec

Upvotes: 6

Related Questions