"Update" is unknown import symbol

I wrote Python code for a basic Telegram bot through replit.

In the shell I wrote: pip install python-telegram-bot==13.7

Until now it was working for me, but from now on, it writes me things like: “Update” is unknown import symbol, “Filters” is unknown import symbol, and the main error is: Traceback (most recent call last): File "/home/runner/PeachpuffSquareTraining/main.py", line 1, in <module> from telegram import Update ImportError: cannot import name 'Update' from 'telegram' (/home/runner/PeachpuffSquareTraining/.pythonlibs/lib/python3.10/site-packages/telegram/__init__.py)

This is the code I tried, and until now with the above pip it was working for me:

from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackContext

# Replace 'YOUR_BOT_TOKEN' with the actual token you obtained from BotFather
TOKEN = 'the token is secret'

def start(update: Update, context: CallbackContext) -> None:
    update.message.reply_text('Hello! I am your bot.')

def echo(update: Update, context: CallbackContext) -> None:
    update.message.reply_text(update.message.text)

def main() -> None:
    updater = Updater(TOKEN)

    dp = updater.dispatcher

    # Command handlers
    dp.add_handler(CommandHandler("start", start))

    # Message handler for echoing messages
    dp.add_handler(MessageHandler(Filters.text & ~Filters.command, echo))

    # Start the Bot
    updater.start_polling()

    # Run the bot until you send a signal to stop it
    updater.idle()

if __name__ == '__main__':
    main()

What is the problem?

To install the python-telegram-bot module, try typing the command poetry add python-telegram-bot==13.7 into the Shell. Also, to prevent the automatic installation of the telegram module, it is advisable to add this line to the beginning of the .replit file:

disableGuessImports = true

This line will disable the installation of modules when launching your repl.