vicalloy / telegram-shell-bot

A telegram Bot to run shell commands
194 stars 82 forks source link

python-telegram-bot wasn't properly installed? #25

Open guerman5 opened 1 month ago

guerman5 commented 1 month ago

你好,

Archlinux 的更新可能导致了问题,因此我移除了旧的 pipenv 环境,尝试按照最新的 Readme 使用 poetry 进行清新安装。

我确保按照指示进行操作,但仍然遇到困难,请给我一些提示可能出错的地方。

我目前卡在这里无法继续前进:

-- Hi Vicalloy,

Archlinux update broke it, so i removed old pipenv environment and tried to install clean start following the latest Readme with poetry.

I do exactly as instructed. Please give me a hint what could it be wrong.

I'm stuck here:

--

[user@linux telegram-shell-bot]$ . /home/user/.cache/pypoetry/virtualenvs/telegram-shell-bot-z5P1adNf-py3.12/bin/activate
(telegram-shell-bot-py3.12) [user@linux telegram-shell-bot]$ python bot.py
/home/user/.cache/pypoetry/virtualenvs/telegram-shell-bot-z5P1adNf-py3.12/lib/python3.12/site-packages/telegram/utils/request.py:54: UserWarning: python-telegram-bot wasn't properly installed. Please refer to README.rst on how to properly install.
  warnings.warn(
Traceback (most recent call last):
  File "/home/user/.cache/pypoetry/virtualenvs/telegram-shell-bot-z5P1adNf-py3.12/lib/python3.12/site-packages/telegram/utils/request.py", line 36, in <module>
    import telegram.vendor.ptb_urllib3.urllib3 as urllib3
  File "/home/user/.cache/pypoetry/virtualenvs/telegram-shell-bot-z5P1adNf-py3.12/lib/python3.12/site-packages/telegram/vendor/ptb_urllib3/urllib3/__init__.py", line 7, in <module>
    from .connectionpool import (
  File "/home/user/.cache/pypoetry/virtualenvs/telegram-shell-bot-z5P1adNf-py3.12/lib/python3.12/site-packages/telegram/vendor/ptb_urllib3/urllib3/connectionpool.py", line 11, in <module>
    from .exceptions import (
  File "/home/user/.cache/pypoetry/virtualenvs/telegram-shell-bot-z5P1adNf-py3.12/lib/python3.12/site-packages/telegram/vendor/ptb_urllib3/urllib3/exceptions.py", line 2, in <module>
    from .packages.six.moves.http_client import (
ModuleNotFoundError: No module named 'telegram.vendor.ptb_urllib3.urllib3.packages.six.moves'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/telegram-shell-bot/bot.py", line 7, in <module>
    from telegram import InlineKeyboardButton, InlineKeyboardMarkup, constants
  File "/home/user/.cache/pypoetry/virtualenvs/telegram-shell-bot-z5P1adNf-py3.12/lib/python3.12/site-packages/telegram/__init__.py", line 186, in <module>
    from .bot import Bot
  File "/home/user/.cache/pypoetry/virtualenvs/telegram-shell-bot-z5P1adNf-py3.12/lib/python3.12/site-packages/telegram/bot.py", line 106, in <module>
    from telegram.utils.request import Request
  File "/home/user/.cache/pypoetry/virtualenvs/telegram-shell-bot-z5P1adNf-py3.12/lib/python3.12/site-packages/telegram/utils/request.py", line 43, in <module>
    import urllib3  # type: ignore[no-redef]
    ^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'urllib3'
(telegram-shell-bot-py3.12) [user@linux telegram-shell-bot]$ pip list
Package               Version
--------------------- -----------
APScheduler           3.6.3
cachetools            4.2.2
certifi               2022.9.24
delegator.py          0.1.1
pexpect               4.8.0
pip                   24.0
ptyprocess            0.7.0
python-telegram-bot   13.14
pytz                  2022.6
pytz-deprecation-shim 0.1.0.post0
setuptools            65.6.0
six                   1.16.0
tornado               6.1
tzdata                2022.6
tzlocal               4.2
guerman5 commented 1 month ago

For now just downgraded to Python 10. Works with my previous venv, and also from scratch with poetry.