Ask coding questions

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

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!

Voters
klezm
Saibot84
ampersandbar
gerile3
IsaiahPettingil
aimstest
Comments
hotnewtop
Saibot84

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

@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:

Though I can't test it properly.

aimstest

@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

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

install('pyTelegramBotAPI')

This will over-write the default installation.

aimstest

Can someone please help me!!!??

phamn23

this is an old thread but an alternative is to open up the shell to directly run the files because UPM won't run automatically (ie: >>> python main.py)