Ask coding questions

← Back to all posts
How to make Repl.it stop installing the wrong package
aimstest (8)

Hello All,
I have been trying to make a Telegram Bot using the pyTelegramBotAPI. (https://pypi.org/project/pyTelegramBotAPI/)

It requires use of :
import telebot

However, whenever I run the script, Repl.it starts downloading another package called telebot (https://pypi.org/project/telebot/).

How do I force Repl.it to use the wrapper package I want to use, instead of what poetry is causing to install?
Even when I do a pip install pyTelegramBotAPI from the shell, it gets overwritten by the wrong telebot. :\

Is there some way to disable poetry, or this behavior?
I have tried changing the pyproject.toml file, but I'm not too sure what to change there.

Can someone help me please?
Thanks!

Comments
hotnewtop
Saibot84 (49)

I'm having a similar issue with the repl installing dummy-wx when I am trying to use wxPython ... because both packages use the same wx name.

I'm trying to use a .replit file to override it ... but I feel there has to be a better way.

EDIT
Researching my own question, upm guess is guessing that I might need the dummy-wx package. There is a .upm/store.json file that lists the guessed packages. Manually changing .upm/store.json, then doing poetry remove dummy-wx, and installing the local wxpython wheel temporarily fixes the issue.

Saibot84 (49)

@aimstest, it looks like pyproject.toml lists telebot as a dependency instead of pyTelegramBotAPI.
In bash, I think you need to run the following 2 lines of code to switch the dependency:

poetry remove telebot
poetry add pyTelegramBotAPI

Though I can't test it properly.

aimstest (8)

@Saibot84, thanks for the response. It has been 5 months since I had this issue, and I subsequently ended up using another bot framework altogether.

aimstest (8)

Note to self:
Used:
import subprocess
def install (name):
subprocess.call(['pip', 'install', name])

install('pyTelegramBotAPI')

This will over-write the default installation.

aimstest (8)

Can someone please help me!!!??