【发布时间】: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