8000 aiohttp._websocket.reader_c.WebSocketReader object attribute 'parse_frame' is read-only · Issue #24262 · ccxt/ccxt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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

aiohttp._websocket.reader_c.WebSocketReader object attribute 'parse_frame' is read-only #24262

Open
p98m opened this issue Nov 14, 2024 · 6 comments
Assignees
Labels

Comments

@p98m
Copy link
p98m commented Nov 14, 2024

Operating System

MacOS 15.1 (24B83)

Programming Languages

Python

CCXT Version

4.4.30

Description

Nothing works, default installation
The only error i have

Error: 'aiohttp._websocket.reader_c.WebSocketReader' object attribute 'parse_frame' is read-only

0 similar issues in search

pip list
Package            Version
------------------ ---------
aiodns             3.2.0
aiohappyeyeballs   2.4.3
aiohttp            3.11.1
aiosignal          1.3.1
attrs              24.2.0
ccxt               4.4.30
certifi            2024.8.30
cffi               1.17.1
charset-normalizer 3.4.0
cryptography       43.0.3
frozenlist         1.5.0
idna               3.10
multidict          6.1.0
pip                24.0
propcache          0.2.0
pycares            4.4.0
pycparser          2.22
requests           2.32.3
setuptools         75.5.0
typing_extensions  4.12.2
urllib3            2.2.3
yarl               1.17.1

Code

import asyncio
import signal
from datetime import datetime

from ccxt import pro


class OrderBookMonitor:
    def __init__(self, symbol="NEAR/USDT", depth=20):
        self.symbol = symbol
        self.depth = depth
        self.exchange = pro.bybit()
        self.exchange.options["enableRateLimit"] = True
        self.is_running = True

    def stop(self):
        self.is_running = False

    async def display_orderbook(self, orderbook):
        print(f"\n{datetime.now()} {self.symbol} Orderbook")
        print("\nBids:")
        for bid in orderbook["bids"][: self.depth]:
            print(f"Price: {bid[0]}, Amount: {bid[1]}")

        print("\nAsks:")
        for ask in orderbook["asks"][: self.depth]:
            print(f"Price: {ask[0]}, Amount: {ask[1]}")

    async def run(self):
        try:
            await self.exchange.load_markets()
            while self.is_running:
                orderbook = await self.exchange.watch_order_book(
                    self.symbol, self.depth
                )
                await self.display_orderbook(orderbook)

        except Exception as e:
            print(f"Error: {str(e)}")
        finally:
            await self.exchange.close()


async def main():
    monitor = OrderBookMonitor()

    def signal_handler():
        print("\nStopping the monitor...")
        monitor.stop()

    loop = asyncio.get_running_loop()
    for sig in (signal.SIGTERM, signal.SIGINT):
        loop.add_signal_handler(sig, signal_handler)

    await monitor.run()


if __name__ == "__main__":
    asyncio.run(main())


@carlosmiei
Copy link
Collaborator
carlosmiei commented Nov 14, 2024

Hello @p98m, That error is caused by the newest aiohttp version, can you please downgrade it for now while we work on a fix?

3.11.x versions are not working, so I would suggest migrating to 3.10.11

@carlosmiei carlosmiei self-assigned this Nov 14, 2024
@skinderis
Copy link

@carlosmiei thanks, we had the same issue.. Trying to downgrade aiohttp version.

@p98m
Copy link
Author
p98m commented Nov 15, 2024

@carlosmiei @skinderis aiohttp==3.10.*
thanks, it works

@p98m p98m closed this as completed Nov 15, 2024
@carlosmiei carlosmiei reopened this Nov 15, 2024
@carlosmiei
Copy link
Collaborator

@skinderis We're working on a fix to make ccxt compatible with the newest version of aiohttp as well, so for now we will keep this issue opened.

@ttodua

This comment has been minimized.

@ttodua ttodua closed this as completed Jan 31, 2025
@ttodua ttodua reopened this Jan 31, 2025
@ttodua

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Assignees

@carlosmiei carlosmiei

Labels
Projects
None yet
Development

No branches or pull requests

4 participants
0