Poetry installs and the platform uses wrong package telegram

Problem description

Dear Replit Support Team,

I am encountering a persistent issue with the package management system on Replit, specifically when trying to install the python-telegram-bot package using Poetry in my Python project.

Despite my efforts to specify the installation of the python-telegram-bot package in my pyproject.toml, Replit seems to incorrectly install a completely unrelated package named telegram version 0.0.1. Here are the details of the problem:

Project Configuration: I have configured my pyproject.toml to include python-telegram-bot as a dependency. The relevant section of my pyproject.toml file is as follows:
toml

[tool.poetry.dependencies]
python = ">=3.10.0,<3.12"
python-telegram-bot = "^21.1.1"

Expected behavior

from telegram import Chat as TGChat 

should import python-telegram-bot

Actual behavior

from telegram import Chat as TGChat 

installs and import telegram 0.0.1, not python-telegram-bot as expected

Steps to reproduce

create python project and instert in main.py:

from telegram import Chat as TGChat 

then Run

Browser

Chrome

OS

Linux

Device if mobile

no mobile

Plan

free

Hi @alexandrgsv , welcome to the forums!
In your .replit file, add this line below the entrypoint line:

disableGuessImports = true

And try rerunning the repl.


You can access the .replit file, by first clicking on the three dots () next to where it says Files >, then click Show Hidden Files, finally open the .replit file.

Helpful Images



I looked at the official Python telegram bot template and there is also such a dependency by default. Therefore, maybe this dependence is needed?

1 Like