0

我正在尝试制作一个使用 的程序,为此python-telegram-bot我需要使用 Python 3。但是当我尝试使用 Python 3 启动它时,我遇到了一些我不太理解的错误。当我使用内置示例时也会发生同样的情况。有人能解释一下这是什么意思吗?程序的精确输出如下。

2016-06-29 06:17:44,260 - telegram.ext.updater - ERROR - unhandled exception

Traceback (most recent call last):

  File "/usr/local/lib/python3.4/dist-packages/telegram/ext/updater.py", line 105, in _thread_wrapper

    target(*args, **kwargs)

  File "/usr/local/lib/python3.4/dist-packages/telegram/ext/updater.py", line 216, in _start_polling

    self._bootstrap(bootstrap_retries, clean=clean, webhook_url='')

  File "/usr/local/lib/python3.4/dist-packages/telegram/ext/updater.py", line 320, in _bootstrap

    self.bot.setWebhook(webhook_url=webhook_url, certificate=cert)

  File "/usr/local/lib/python3.4/dist-packages/telegram/bot.py", line 121, in decorator

    result = func(self, *args, **kwargs)

   File "/usr/local/lib/python3.4/dist-packages/telegram/bot.py", line 1263, in setWebhook

    result = request.post(url, data, timeout=kwargs.get('timeout'))

  File "/usr/local/lib/python3.4/dist-packages/telegram/utils/request.py", line 174, in post

    headers={'Content-Type': 'application/json'})

  File "/usr/local/lib/python3.4/dist-packages/telegram/utils/request.py", line 100, in _request_wrapper

    resp = _get_con_pool().request(*args, **kwargs)

  File "/usr/lib/python3/dist-packages/urllib3/request.py", line 72, in request

    **urlopen_kw)

  File "/usr/lib/python3/dist-packages/urllib3/request.py", line 135, in request_encode_body

    **urlopen_kw)

TypeError: urlopen() got multiple values for keyword argument 'body'

Exception in thread updater:

Traceback (most recent call last):

  File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner

    self.run()

  File "/usr/lib/python3.4/threading.py", line 868, in run

     self._target(*self._args, **self._kwargs)

  File "/usr/local/lib/python3.4/dist-packages/telegram/ext/updater.py", line 105, in _thread_wrapper

    target(*args, **kwargs)

  File "/usr/local/lib/python3.4/dist-packages/telegram/ext/updater.py", line 216, in _start_polling

    self._bootstrap(bootstrap_retries, clean=clean, webhook_url='')

  File "/usr/local/lib/python3.4/dist-packages/telegram/ext/updater.py", line 320, in _bootstrap

    self.bot.setWebhook(webhook_url=webhook_url, certificate=cert)

  File "/usr/local/lib/python3.4/dist-packages/telegram/bot.py", line 121, in decorator

    result = func(self, *args, **kwargs)

  File "/usr/local/lib/python3.4/dist-packages/telegram/bot.py", line 1263, in setWebhook

    result = request.post(url, data, timeout=kwargs.get('timeout'))

  File "/usr/local/lib/python3.4/dist-packages/telegram/utils/request.py", line 174, in post

    headers={'Content-Type': 'application/json'})

  File "/usr/local/lib/python3.4/dist-packages/telegram/utils/request.py", line 100, in _request_wrapper

    resp = _get_con_pool().request(*args, **kwargs)

  File "/usr/lib/python3/dist-packages/urllib3/request.py", line 72, in request

    **urlopen_kw)

  File "/usr/lib/python3/dist-packages/urllib3/request.py", line 135, in request_encode_body

    **urlopen_kw)

TypeError: urlopen() got multiple values for keyword argument 'body'

2016-06-29 06:17:45,248 - telegram.ext.dispatcher - CRITICAL - stopping due to exception in another thread
4

1 回答 1

0

为此,请urllib3>=1.10从包管理器安装。

于 2016-06-29T15:01:58.800 回答