GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Error importing Uniswap with the latest version of web3.py · Issue #322 · uniswap-python/uniswap-python

Error importing Uniswap with the latest version of web3.py #322

New issue
Copy link
New issue
Copy link
Closed
#320
Closed
Error importing Uniswap with the latest version of web3.py#322
#320
Copy link
Labels
bugSomething isn't workingSomething isn't working

Description

@arjunaskykok
arjunaskykok
opened on Mar 6, 2023
Issue body actions

Describe the bug

>>> from uniswap import Uniswap
from web3.contract import Contract, ContractFunction
ImportError: cannot import name 'ContractFunction' from 'web3.contract'

To Reproduce

$ python3.11 -m venv .venv
$ source .venv/bin/activate
(.venv) $ pip install git+https://github.com/ethereum/web3.py.git
(.venv) $ pip install uniswap-python
(.venv) $ python
Python 3.11.2 (main, Feb  8 2023, 14:49:24) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from uniswap import Uniswap
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/arjuna/.../review_uniswap_python/.venv/lib/python3.11/site-packages/uniswap/__init__.py", line 2, in <module>
    from .uniswap import Uniswap, _str_to_addr
  File "/home/arjuna/.../review_uniswap_python/.venv/lib/python3.11/site-packages/uniswap/uniswap.py", line 11, in <module>
    from web3.contract import Contract, ContractFunction
ImportError: cannot import name 'ContractFunction' from 'web3.contract' (/home/arjuna/.../review_uniswap_python/.venv/lib/python3.11/site-packages/web3/contract/__init__.py)
>>> from web3.contract import ContractFunction
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'ContractFunction' from 'web3.contract' (/home/arjuna/.../review_uniswap_python/.venv/lib/python3.11/site-packages/web3/contract/__init__.py)
>>> from web3.contract.contract import ContractFunction
>>>

Expected behavior
We should be able to import Uniswap with the latest version of web3.

Additional context
The reason I installed web3.py from GitHub repo is Python3.11 doesn't work with web3.py from pip.

ImportError: cannot import name 'getargspec' from 'inspect' (/usr/lib/python3.11/inspect.py)

Activity

  1. arjunaskykok
    added
    bugSomething isn't workingSomething isn't working
    on Mar 6, 2023
  2. ErikBjare commented on Mar 6, 2023

    @ErikBjare
    ErikBjare
    on Mar 6, 2023
    Member
    More actions

    Working on a fix in #320

  3. Lodimup commented on Mar 24, 2023

    @Lodimup
    Lodimup
    on Mar 24, 2023
    More actions

    web3 = "5.24" works

  4. Moka51 commented on Mar 26, 2023

    @Moka51
    Moka51
    on Mar 26, 2023
    More actions

    Any update about this? Thanks in advance team!

  5. DavidZQuant commented on Mar 27, 2023

    @DavidZQuant
    DavidZQuant
    on Mar 27, 2023
    More actions

    Running into the same problem

    Reacted by Adam Auer and Daria Tar
  6. ErikBjare
    closed this as completedin #320on Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.