d60 / twikit

Twitter API Scraper | Without an API key | Twitter Internal API | Free | Twitter scraper | Twitter Bot

Home Page:https://twikit.readthedocs.io/en/latest/twikit.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

PayneXie opened this issue · comments

from twikit import Client

Traceback (most recent call last): File "/Users/paynexie/FollowStatsCollector/test.py", line 1, in <module> from twikit import Client File "/Users/paynexie/FollowStatsCollector/venv/lib/python3.9/site-packages/twikit/__init__.py", line 9, in <module> from .client import Client File "/Users/paynexie/FollowStatsCollector/venv/lib/python3.9/site-packages/twikit/client.py", line 12, in <module> from .errors import ( File "/Users/paynexie/FollowStatsCollector/venv/lib/python3.9/site-packages/twikit/errors.py", line 31, in <module> class TooManyRequests(TwitterException): File "/Users/paynexie/FollowStatsCollector/venv/lib/python3.9/site-packages/twikit/errors.py", line 35, in TooManyRequests def __init__(self, *args, headers: dict | None = None) -> None: TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

commented

Use Python version 3.10 or above, or insert from __future__ import annontations at the top of twikit/errors.py.