Answer the question
In order to leave comments, you need to log in
How to fix AttributeError: module 'telebot.types' has no attribute 'User' error?
import telebot
import sqlite3
from telebot import types
from random import randint
Traceback (most recent call last):
File "C:/Users/HOME/PycharmProjects/Кеша бот python/Новий бот-Ігра/main.py", line 3, in <module>
from telebot import types
File "C:\Users\HOME\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\telebot\types.py", line 12, in <module>
from telebot import util
File "C:\Users\HOME\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\telebot\util.py", line 307, in <module>
def user_link(user: types.User, include_id: bool=False) -> str:
AttributeError: module 'telebot.types' has no attribute 'User'
Answer the question
In order to leave comments, you need to log in
> C:\Users\HOME\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\ telebot \types.py Installed
via pip installbot? Congratulations, you installed the wrong package. You need the pyTelegramBotAPI package instead. Yes, there are two. Yes, both are imported as telebot. Yes, it's stupid. You just need to be more careful when you put dependencies.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question