2016-06-29 56 views
0

我试图制作一个程序,使用python-telegram-bot,我需要使用Python 3。但是当我尝试使用Python 3启动它时,出现了一些我不太明白的错误。当我使用内置示例时也会发生同样的情况。有人可以解释它的意思吗?程序的精确输出如下。python-telegram-bot在Python 3.x上无法正常工作

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 
+0

在其存储库中创建一个问题:https://github.com/python-telegram-bot/python-telegram-bot/issues/new – ihoru

+0

@ihoru完成,感谢指针。 – Danya02

回答

0

对于这个工作,从包管理器安装urllib3>=1.10

相关问题