Ошибка импорта Dispatcher и executor из aiogram
Только начала разбираться в программировании телеботов, не получается импортировать Dispatcher и executor.
from aiogram import Bot, Dispatcher
from aiogram_utils import executor
bot=Bot(token="...")
dp=Dispatcher(bot)
@dp.message_handler()
async def get_message(message:types.Message):
chat_id=message.chat.id
text='hOW ARE YOU?'
sent_message= await bot.send_message(chat_id=chat_id, text=text)
print(sent_message.to_python())
executor.start_polling(dp)
Пишет, что ошибка импорта:
from aiogram import Dispatcher
ImportError: cannot import name 'Dispatcher' from partially initialized module 'aiogram' (most likely due to a circular import)
Ответы (2 шт):
Автор решения: Alexandr
→ Ссылка
Попробуйте так:
from aiogram import Bot, types
from aiogram.dispatcher import Dispatcher
from aiogram.utils import executor
Автор решения: Bemfes
→ Ссылка
Я ввела так, и все заработало
import aiogram
from aiogram import Bot, Dispatcher, executor, types