Home>

It is impossible to install the bot Telegram, I tried already a bunch of everything .. But it does not work and everything .. every time different errors ..

via python3

root @ FHDF: ~ /VOV # python3 main.py
Traceback (MOST Recent Call Last):
  File "main.py", Line 5, in ≪
Module >
    Import Menu.
  File "/root/vov/menu.py", Line 1, in ≪
Module >
    From Telebot Import Types
Importerror: CANNOT IMPORT NAME 'TYPES'

Installed Libraries

root @ FHDF: ~ /VOV # pip freeze
ASN1Crypto== 0.24.0.
CERTIFI== 2020.12.5.
Chardet== 4.0.0
Configobj== 5.0.6
Cryptography== 2.1.4
Decorator== 4.1.2
enum34== 1.1.6
IDNA== 2.6.
ipaddress== 1.0.17
KEYRING== 10.6.0.
Keyrings.alt== 3.0
pycrypto== 2.6.1
Pygobject== 3.26.1
pytelegrambotapi== 3.7.7
pyudev== 0.21.0.
pyxdg== 0.25
Requests== 2.25.1
SecretStorage== 2.3.1
Six== 1.11.0
URLLIB3== 1.26.4.
root @ FHDF: ~ /VOV #

via python

root @ FHDF: ~ /VOV # python main.py
  File "main.py", Line 42
    Bot.Send_Message (Chat_id= Func.admin_id_own (), text= f "New User @ {Me Ssage.chat.userName}")
                                                                                                                                                                       ^
SYNTAXERROR: INVALID SYNTAX
root @ FHDF: ~ /VOV #

In /root /vov there is a TELEBOT.PY file? In the second error, the variable is broken in the string, there should not be spaces: @ {me ssage

gil9red2021-04-08 05:12:51

No, there is no such file, there are no downtime gaps in the code.

TRO9I2021-04-08 05:20:01

OK, make sure that Python, which was put by the bot library, the same that you run. Try to use not PIP, and PIP3

gil9red2021-04-08 05:32:48

So I wrote that there is a mistake there. You do not all be indicated and what errors ..

TRO9I2021-04-08 05:37:09

Do you think Python is different from Python3 and PIP from PIP3? :) Python Most likely you have a Linux, it is Python2, then it is clear why the syntax error when using the F-rows and why the libraries installed in Python2 does not see them when starting in Python3

gil9red2021-04-08 05:39:48
  • Answer # 1

    I decided the problem. Installed library Sudo Apt-Get Install Python3-Pil And everything worked.