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' #209

Open
StayFoolisj opened this issue Jul 8, 2023 · 4 comments
Open

ImportError: cannot import name 'getargspec' from 'inspect' #209

StayFoolisj opened this issue Jul 8, 2023 · 4 comments

Comments

@StayFoolisj
Copy link

Having some issues trying to run the basic examples. The error is an importError from inspect.getargspec(). A quick search shows that it was depreciated with Python 3, and deleted with 3.11. Raising an issue since you wrote that this repo is tested against 3.11.

Specs / Versions:

Macbook M1 ARM64
Python 3.11.3
dydx-v3-python     2.0.1
ecdsa              0.18.0
eth-abi            2.2.0
eth-account        0.5.9
eth-hash           0.5.2
eth-keyfile        0.5.1
eth-keys           0.3.4
eth-rlp            0.2.1
eth-typing         2.3.0
eth-utils          1.9.5

When I try to run the test example in the README.md:

from dydx3 import Client
from web3 import Web3

#
# Access public API endpoints.
#
public_client = Client(
    host='http://localhost:8080',
)
public_client.public.get_markets()

I get the following error:

Traceback (most recent call last):
  File "/code/trade_repo/src/trade_lab.py", line 1, in <module>
    from dydx3 import Client
  File "/code/trade_repo/.venv/lib/python3.11/site-packages/dydx3/__init__.py", line 1, in <module>
    from dydx3.dydx_client import Client
  File "/code/trade_repo/.venv/lib/python3.11/site-packages/dydx3/dydx_client.py", line 1, in <module>
    from web3 import Web3
  File "/code/trade_repo/.venv/lib/python3.11/site-packages/web3/__init__.py", line 6, in <module>
    from eth_account import (
  File "/code/trade_repo/.venv/lib/python3.11/site-packages/eth_account/__init__.py", line 1, in <module>
    from eth_account.account import (
  File "/code/trade_repo/.venv/lib/python3.11/site-packages/eth_account/account.py", line 59, in <module>
    from eth_account.messages import (
  File "/code/trade_repo/.venv/lib/python3.11/site-packages/eth_account/messages.py", line 26, in <module>
    from eth_account._utils.structured_data.hashing import (
  File "/code/trade_repo/.venv/lib/python3.11/site-packages/eth_account/_utils/structured_data/hashing.py", line 9, in <module>
    from eth_abi import (
  File "/code/trade_repo/.venv/lib/python3.11/site-packages/eth_abi/__init__.py", line 6, in <module>
    from eth_abi.abi import (  # NOQA
  File "/code/trade_repo/.venv/lib/python3.11/site-packages/eth_abi/abi.py", line 1, in <module>
    from eth_abi.codec import (
  File "/code/trade_repo/.venv/lib/python3.11/site-packages/eth_abi/codec.py", line 16, in <module>
    from eth_abi.decoding import (
  File "/code/trade_repo/.venv/lib/python3.11/site-packages/eth_abi/decoding.py", line 14, in <module>
    from eth_abi.base import (
  File "/code/trade_repo/.venv/lib/python3.11/site-packages/eth_abi/base.py", line 7, in <module>
    from .grammar import (
  File "/code/trade_repo/.venv/lib/python3.11/site-packages/eth_abi/grammar.py", line 4, in <module>
    import parsimonious
  File "/code/trade_repo/.venv/lib/python3.11/site-packages/parsimonious/__init__.py", line 9, in <module>
    from parsimonious.grammar import Grammar, TokenGrammar
  File "/code/trade_repo/.venv/lib/python3.11/site-packages/parsimonious/grammar.py", line 14, in <module>
    from parsimonious.expressions import (Literal, Regex, Sequence, OneOf,
  File "/code/trade_repo/.venv/lib/python3.11/site-packages/parsimonious/expressions.py", line 9, in <module>
    from inspect import getargspec
ImportError: cannot import name 'getargspec' from 'inspect' (/opt/homebrew/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/inspect.py)
@HydeSong
Copy link

@StayFoolisj I get the same error. Have you solved it?

@Otnicka1
Copy link

workaround :
Edit this file :
image
Replace from inspect import getargspec ==> from inspect import getfullargspec

@sirEven
Copy link

sirEven commented Dec 14, 2023

Getting same error have you solved it?

FWIW, you might wanna try my PR. I specifically mentioned this issue here, because i try to solve these errors there - which for now works fine on my end. I am using Python 3.11.4.
Sepolia migration has been merged in already.

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

No branches or pull requests

5 participants
@HydeSong @sirEven @StayFoolisj @Otnicka1 and others