@skyspirit

Как убрать ошибку запуска Python?

Microsoft Windows [Version 10.0.22621.1702]
(c) Microsoft Corporation. All rights reserved.

C:\Users\bolshukhin_roman>telegram-send --configure
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\bolshukhin_roman\AppData\Local\Programs\Python\Python311\Scripts\telegram-send.exe\__main__.py", line 4, in <module>
  File "C:\Users\bolshukhin_roman\AppData\Local\Programs\Python\Python311\Lib\site-packages\telegram_send.py", line 29, in <module>
    from telegram.constants import MAX_MESSAGE_LENGTH
ImportError: cannot import name 'MAX_MESSAGE_LENGTH' from 'telegram.constants' (C:\Users\bolshukhin_roman\AppData\Local\Programs\Python\Python311\Lib\site-packages\telegram\constants.py)


pip install telegram-send
Requirement already satisfied: telegram-send in c:\users\bolshukhin_roman\appdata\local\programs\python\python311\lib\site-packages (0.13)
Requirement already satisfied: appdirs in c:\users\bolshukhin_roman\appdata\local\programs\python\python311\lib\site-packages (from telegram-send) (1.4.4)
Requirement already satisfied: colorama in c:\users\bolshukhin_roman\appdata\local\programs\python\python311\lib\site-packages (from telegram-send) (0.4.6)
Requirement already satisfied: python-telegram-bot>=5.0 in c:\users\bolshukhin_roman\appdata\local\programs\python\python311\lib\site-packages (from telegram-send) (20.3)
Requirement already satisfied: httpx~=0.24.0 in c:\users\bolshukhin_roman\appdata\local\programs\python\python311\lib\site-packages (from python-telegram-bot>=5.0->telegram-send) (0.24.1)
Requirement already satisfied: certifi in c:\users\bolshukhin_roman\appdata\local\programs\python\python311\lib\site-packages (from httpx~=0.24.0->python-telegram-bot>=5.0->telegram-send) (2023.5.7)
Requirement already satisfied: httpcore<0.18.0,>=0.15.0 in c:\users\bolshukhin_roman\appdata\local\programs\python\python311\lib\site-packages (from httpx~=0.24.0->python-telegram-bot>=5.0->telegram-send) (0.17.2)
Requirement already satisfied: idna in c:\users\bolshukhin_roman\appdata\local\programs\python\python311\lib\site-packages (from httpx~=0.24.0->python-telegram-bot>=5.0->telegram-send) (3.4)
Requirement already satisfied: sniffio in c:\users\bolshukhin_roman\appdata\local\programs\python\python311\lib\site-packages (from httpx~=0.24.0->python-telegram-bot>=5.0->telegram-send) (1.3.0)
Requirement already satisfied: h11<0.15,>=0.13 in c:\users\bolshukhin_roman\appdata\local\programs\python\python311\lib\site-packages (from httpcore<0.18.0,>=0.15.0->httpx~=0.24.0->python-telegram-bot>=5.0->telegram-send) (0.14.0)
Requirement already satisfied: anyio<5.0,>=3.0 in c:\users\bolshukhin_roman\appdata\local\programs\python\python311\lib\site-packages (from httpcore<0.18.0,>=0.15.0->httpx~=0.24.0->python-telegram-bot>=5.0->telegram-send) (3.7.0)

<b>pip install python-telegram-bot configargparse</b>
Requirement already satisfied: python-telegram-bot in c:\users\bolshukhin_roman\appdata\local\programs\python\python311\lib\site-packages (20.3)
Requirement already satisfied: configargparse in c:\users\bolshukhin_roman\appdata\local\programs\python\python311\lib\site-packages (1.5.3)
Requirement already satisfied: httpx~=0.24.0 in c:\users\bolshukhin_roman\appdata\local\programs\python\python311\lib\site-packages (from python-telegram-bot) (0.24.1)
Requirement already satisfied: certifi in c:\users\bolshukhin_roman\appdata\local\programs\python\python311\lib\site-packages (from httpx~=0.24.0->python-telegram-bot) (2023.5.7)
Requirement already satisfied: httpcore<0.18.0,>=0.15.0 in c:\users\bolshukhin_roman\appdata\local\programs\python\python311\lib\site-packages (from httpx~=0.24.0->python-telegram-bot) (0.17.2)
Requirement already satisfied: idna in c:\users\bolshukhin_roman\appdata\local\programs\python\python311\lib\site-packages (from httpx~=0.24.0->python-telegram-bot) (3.4)
Requirement already satisfied: sniffio in c:\users\bolshukhin_roman\appdata\local\programs\python\python311\lib\site-packages (from httpx~=0.24.0->python-telegram-bot) (1.3.0)
Requirement already satisfied: h11<0.15,>=0.13 in c:\users\bolshukhin_roman\appdata\local\programs\python\python311\lib\site-packages (from httpcore<0.18.0,>=0.15.0->httpx~=0.24.0->python-telegram-bot) (0.14.0)
Requirement already satisfied: anyio<5.0,>=3.0 in c:\users\bolshukhin_roman\appdata\local\programs\python\python311\lib\site-packages (from httpcore<0.18.0,>=0.15.0->httpx~=0.24.0->python-telegram-bot) (3.7.0)
  • Вопрос задан
  • 291 просмотр
Пригласить эксперта
Ответы на вопрос 2
RimMirK
@RimMirK
Вроде человек. Вроде учусь. Вроде пайтону
используй нормальную библиотеку
PyTelegramBotAPI
Ответ написан
Комментировать
SoreMix
@SoreMix Куратор тега Python
yellow
Библиотека давно уже устарела. В зависимой либе уже давно другая структура в файле constants.py

Либо ищите замену своей либе, или загрузите python-telegram-bot версии 13.10 или около того: https://github.com/python-telegram-bot/python-tele...
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы