#๐ The library is installed but writes telebot import
106 messages ยท Page 1 of 1 (latest)
@candid rover
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
I don't use telegram or anything but I'm pretty sure you just showed your bot token
First of all, don't expose your TOKEN like that. Now you have to roll another.
Secondly, what was the command you used to install telebot?
Thirdly, please rename your bot.py file to something else. Because your code also uses the same name bot for its commands, so its going to be confusing for Python to know which one you're referring to if you import bot.py into somewhere.
Maybe like mybot.py or something
No, there's another problem here, I install the library, but it keeps saying the Import and library name
If you tell me how to do it, I'll be grateful
Can you tell me how you installed the library?
Yes
There's 2 libraries here that uses the same package name. telebot and pyTelegramBotAPI. Which one are you using?
What was the command?
I go to the site, go to the terminal, I write there, it writes install and the name of the library is downloaded, then I write to use the import library or under the type of the name of the library, well, at the bottom it is constantly written to import the name of the library
What did you write in the terminal??
Thanks. And what did you write in the terminal to install it?
Try with py -m or consider using a virtualenv
Could you explain to me the problem from the very start?
Tell me how it will look on the example
Yes
py -m pip install <insert your package name here>
@candid rover I deleted the screenshots because they contain your bot token
Ok
please invalidate those tokens, and then post the relevant code as text (not a screenshot) with the tokens removed.
Sorry
I've already been helped Well, thank you
Okay ๐๐
without the <>
Bro, I've already downloaded it
show me that you ran the command correctly
ok good. Now check your Python Interpreter by opening the command pallete and find "Select Interpreter" for Python
Show me what Python versions and interpreters you have
It should look something like this
I assume you have it installed in 3.13... so pick the "Recommended" one
Then it should be fixed
I'll ask from the GPT chat, he said that the library doesn't work on the newest version
Why won't it work?
test it
So you're there about you
Did you test it?
What exactly did you check
I don't have to check.
You're supposed to check if your telegram bot is working or not
You probably didn't install it in 3.13 but in 3.10
Either switch your Interpreter to 3.10 or run the py -m pip install pytelegrambotapi command again
Then test it again
Python's version is the same
It shows here that you have 3.13.3 and 3.10.11. Either switch to 3.10.11 or run the pip install again
Bro
idk if you changed anything
What happens if you run your python script? Put your TOKEN back in and test it
you didn't put your TOKEN back
DONT SHOW YOUR TOKEN MF
DELETE THAT!
JUST RUN YOUR BOT
Not deleted
NO! I MEAN DELETE THIS SCREENSHOT!
What does your terminal show?
ITS NOT EVEN RUNNING!
Look
Just put your token in your code
Then run your bot
py bot.py
Now where is the page lick about environment variables in my book lick.
This will be usefull for you in the future or now.
https://www.freecodecamp.org/news/python-env-vars-how-to-get-an-environment-variable-in-python/
https://pypi.org/project/python-dotenv/
And how to make it work
I just told you
Put your token in your code
run your bot
py bot.py
And then test it
Do you understand @candid rover ?
You didnt save the file after you added the token.
ALSO FOR THE LOVE OF GOD STOP EXPOSING YOUR TOKEN.
@candid rover your token is a password. if you keep showing it, you're going to get hacked and possibly get banned from telegram or incur expenses that you will be required to pay.
understand?
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.