A
A
Andrey Andreev2019-11-03 17:31:01
Python
Andrey Andreev, 2019-11-03 17:31:01

AttributeError: partially initialized module 'telebot' what to do?

import telebot
bot = telebot.Telebot (token)
@bot.message_handler(content_types=['text'])
def send_echo(message):
bot.reply_to(message, message.text)
bot.polling( none_stop = True)
Here is my wish just create a telegram bot pip pytelegrambotapi but the error is constant,
I climbed all the forums github, stackoverflow, cyberforum, etc. I tried it myself but nothing came out,
well, I read that there is no TeleBot attribute in telebot, only where should I insert it.
Here is the
Traceback error (most recent call last) :
File "telebot.py", line 2, in
import telebot
File "C:\Users\user\OneDrive\Desktop\Python\telebot.py", line 4, in
bot = telebot.Telebot(token)
AttributeError: partially initialized module 'telebot' has no attribute 'Telebot' (most likely due to a circular import)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
iromess, 2020-01-14
@iromess

The problem is that the module name and file name are the same ("telebot.py"). Change your name

A
Andrey Andreev, 2019-12-20
@Scripteer

Did not help

L
LeMoNtAck, 2020-08-23
@LeMoNtAck

it turns out it is impossible to name files by names that are already occupied by libraries?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question