【问题标题】:telegram bot proxy in pythonpython中的电报机器人代理
【发布时间】:2020-06-17 16:34:46
【问题描述】:

我正在使用 Telebot 为 Telegram 制作 Python 机器人

bot = telebot.TeleBot('TokenHere')
apihelper.proxy = {'https': 'socks5://user:password@127.0.0.1:1080'}
@bot.message_handler(commands=['start', 'help'])
def send_welcome(message):
    bot.reply_to(message, "Hello?")

我安装了最新版本:gunicorn、PySocks、pyTelegramBotAPI、requests 和 urllib3

仍然收到错误:

AssertionError: Not supported proxy scheme socks5

代理工作正常,我用另一个机器人检查了它。

【问题讨论】:

  • 确保您拥有最新版本的 pysocks。运行pip install -U pysocks 看看它是否有效
  • 要求已经更新:/usr/lib/python2.7/site-packages (1.7.1) 中的 pysocks

标签: python proxy telegram telegram-bot pysocks


【解决方案1】:

刚刚通过 yum 删除了一个 python-requests,然后通过 pip 安装

【讨论】:

    猜你喜欢
    • 2018-02-27
    • 2020-10-28
    • 1970-01-01
    • 2017-08-18
    • 2022-01-01
    • 2021-02-21
    • 1970-01-01
    • 2021-02-02
    • 2017-09-11
    相关资源
    最近更新 更多