#๐Ÿ”’ The library is installed but writes telebot import

106 messages ยท Page 1 of 1 (latest)

leaden ospreyBOT
#

@candid rover

Python help channel opened

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.

uneven skiff
#

I don't use telegram or anything but I'm pretty sure you just showed your bot token

strange widget
#

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

candid rover
#

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

strange widget
candid rover
#

Yes

strange widget
#

There's 2 libraries here that uses the same package name. telebot and pyTelegramBotAPI. Which one are you using?

strange widget
candid rover
#

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

strange widget
candid rover
#

pyTelegramBotAPI

#

Pip install

strange widget
strange widget
obsidian edge
#

Could you explain to me the problem from the very start?

candid rover
strange widget
chilly blade
#

@candid rover I deleted the screenshots because they contain your bot token

chilly blade
#

please invalidate those tokens, and then post the relevant code as text (not a screenshot) with the tokens removed.

candid rover
obsidian edge
candid rover
strange widget
candid rover
strange widget
candid rover
strange widget
# candid rover

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

candid rover
#

1 minute

strange widget
candid rover
strange widget
# candid rover

I assume you have it installed in 3.13... so pick the "Recommended" one

#

Then it should be fixed

candid rover
#

I'll ask from the GPT chat, he said that the library doesn't work on the newest version

candid rover
#

I don't know

#

And what's next

strange widget
#

test it

candid rover
#

Ok

#

I'm waiting

candid rover
strange widget
candid rover
#

What exactly did you check

strange widget
#

I don't have to check.

strange widget
candid rover
#

The same

strange widget
#

Either switch your Interpreter to 3.10 or run the py -m pip install pytelegrambotapi command again

#

Then test it again

candid rover
#

Python's version is the same

strange widget
# candid rover

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

candid rover
#

I installed the same thing

strange widget
#

idk if you changed anything

candid rover
strange widget
# candid rover

What happens if you run your python script? Put your TOKEN back in and test it

candid rover
#

Well, there's a mistake

strange widget
#

DONT SHOW YOUR TOKEN MF

#

DELETE THAT!

#

JUST RUN YOUR BOT

candid rover
#

Not deleted

strange widget
#

NO! I MEAN DELETE THIS SCREENSHOT!

candid rover
strange widget
#

FINALLY!

#

NEVER SHARE YOUR TOKEN

candid rover
#

Ok

#

The bot doesn't respond

strange widget
#

What does your terminal show?

candid rover
strange widget
#

Look

#

Just put your token in your code

#

Then run your bot

#

py bot.py

dusk barn
candid rover
#

And how to make it work

strange widget
#

Put your token in your code

#

run your bot

#

py bot.py

#

And then test it

#

Do you understand @candid rover ?

candid rover
#

A

#

Yes

#

That's how I placed my token

dusk barn
# candid rover

You didnt save the file after you added the token.

ALSO FOR THE LOVE OF GOD STOP EXPOSING YOUR TOKEN.

chilly blade
#

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

leaden ospreyBOT
#
Python help channel closed for inactivity

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.