导入错误:无法从'inspect'导入名称'getargspec' (C:\Users\Swapn\AppData\Local\Programs\Pytho


File "f:drug-traceability-blockchain-maddysrcapp.py", line 2, in <module>
from web3 import Web3,HTTPProvider
File "C:UsersSwapnAppDataLocalProgramsPythonPython311Libsite-packagesweb3__init__.py", line 6, in <module>
from eth_account import (
File "C:UsersSwapnAppDataLocalProgramsPythonPython311Libsite-packageseth_account__init__.py", line 1, in <module>
from eth_account.account import (
File "C:UsersSwapnAppDataLocalProgramsPythonPython311Libsite-packageseth_accountaccount.py", line 59, in <module>
from eth_account.messages import (
File "C:UsersSwapnAppDataLocalProgramsPythonPython311Libsite-packageseth_accountmessages.py", line 26, in <module>
from eth_account._utils.structured_data.hashing import (
File "C:UsersSwapnAppDataLocalProgramsPythonPython311Libsite-packageseth_account_utilsstructured_datahashing.py", line 9, in <module>
from eth_abi import (
File "C:UsersSwapnAppDataLocalProgramsPythonPython311Libsite-packageseth_abi__init__.py", line 6, in <module>
from eth_abi.abi import (  # NOQA
File "C:UsersSwapnAppDataLocalProgramsPythonPython311Libsite-packageseth_abiabi.py", line 1, in <module>
from eth_abi.codec import (
File "C:UsersSwapnAppDataLocalProgramsPythonPython311Libsite-packageseth_abicodec.py", line 16, in <module>
from eth_abi.decoding import (
File "C:UsersSwapnAppDataLocalProgramsPythonPython311Libsite-packageseth_abidecoding.py", line 14, in <module>
from eth_abi.base import (
File "C:UsersSwapnAppDataLocalProgramsPythonPython311Libsite-packageseth_abibase.py", line 7, in <module>
from .grammar import (
File "C:UsersSwapnAppDataLocalProgramsPythonPython311Libsite-packageseth_abigrammar.py", line 4, in <module>
import parsimonious
File "C:UsersSwapnAppDataLocalProgramsPythonPython311Libsite-packagesparsimonious__init__.py", line 9, in <module>
from parsimonious.grammar import Grammar, TokenGrammar
File "C:UsersSwapnAppDataLocalProgramsPythonPython311Libsite-packagesparsimoniousgrammar.py", line 14, in <module>
from parsimonious.expressions import (Literal, Regex, Sequence, OneOf,
File "C:UsersSwapnAppDataLocalProgramsPythonPython311Libsite-packagesparsimoniousexpressions.py", line 9, in <module>
from inspect import getargspec
ImportError: cannot import name 'getargspec' from 'inspect' (C:UsersSwapnAppDataLocalProgramsPythonPython311Libinspect.py)   

请帮帮我…如何解决此错误。这是我从github下载的区块链项目。在那之后npm安装npm开始松露complile松露迁移以及项目主页运行app.py,然后我收到这个错误。运行错误图像

要么贬低python

或转到python3.11/site-packages/parsiious/expressions.py并将gettargespec替换为getfullargspec

尝试使用pip uninstall web3.py卸载web3,并使用pip install git+https://github.com/ethereum/web3.py.git从github安装最新版本

如果您通过pip安装web3.py,在更新被批准时它仍然无法工作,它仍然安装旧版本。运行pip uninstall web3要卸载旧版本,运行pip install git+https://github.com/ethereum/web3.py.git从GitHub安装新版本。

最新更新