【问题标题】:ImportError: cannot import name 'getargspec' from 'inspect' (C:\Users\Swapn\AppData\Local\Programs\Python\Python311\Lib\inspect.py)ImportError: 无法从 \'inspect\' 导入名称 \'getargspec\' (C:\\Users\\Swapn\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\inspect.py)
【发布时间】:2022-12-21 04:16:32
【问题描述】:
 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)   

请帮助我..如何解决这个错误。 这是我从 github 下载的区块链项目 wgich。 在那之后我是 npm 安装 npm 开始 松露编译 松露迁移 和项目的主页 运行 app.py 然后我收到这个错误。Image of running errors

【问题讨论】:

  • 检查模块中没有getargspec。不过有一个getfullargspec。 getargspec 来自 python2 days
  • 怎么解决这个
  • 要么使用 python2,要么找一个不同的项目
  • 如何将 python3 降级为 python2 兄弟?
  • 你不...他们是两个不同的口译员。您需要下载 python2 并安装它

标签: python python-3.x python-2.7 blockchain importerror


【解决方案1】:

要么贬值python

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

【讨论】:

    猜你喜欢
    • 2022-07-07
    • 1970-01-01
    • 2022-11-15
    • 1970-01-01
    • 2020-02-26
    • 1970-01-01
    • 2021-12-28
    • 2021-02-22
    • 1970-01-01
    相关资源
    最近更新 更多