youfou / wxpy

微信机器人 / 可能是最优雅的微信个人号 API ✨✨
http://wxpy.readthedocs.io
MIT License
14.04k stars 2.39k forks source link

ubuntu 14.04 登录后不久就报错 #167

Open raintwice opened 7 years ago

raintwice commented 7 years ago

Ubuntu 14.04 python2.7.6 仅仅输入以下两句

from wxpy import * bot = Bot(True, console_qr=True) 过一会,自动报错 Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/itchat/components/login.py", line 231, in maintain_loop i = sync_check(self) File "/usr/local/lib/python2.7/dist-packages/itchat/components/login.py", line 283, in sync_check r = self.s.get(url, params=params, headers=headers) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 467, in get return self.request('GET', url, kwargs) File "/usr/local/lib/python2.7/dist-packages/wxpy/utils/misc.py", line 351, in customized_request return requests.Session.request(session, method, url, kwargs) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 455, in request resp = self.send(prep, send_kwargs) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 558, in send r = adapter.send(request, kwargs) File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 316, in send timeout = TimeoutSauce(connect=timeout, read=timeout) File "/usr/lib/python2.7/dist-packages/urllib3/util.py", line 116, in init self._connect = self._validate_timeout(connect, 'connect') File "/usr/lib/python2.7/dist-packages/urllib3/util.py", line 147, in _validate_timeout "int or float." % (name, value)) ValueError: Timeout value connect was (10, 30), but it must be an int or float.

raintwice commented 7 years ago

python3 也一样 Python 3.4.3 (default, Nov 17 2016, 01:11:57) [GCC 4.8.4] on linux Type "help", "copyright", "credits" or "license" for more information.

from wxpy import * bot = Bot(True, console_qt= True) Traceback (most recent call last): File "", line 1, in TypeError: init() got an unexpected keyword argument 'console_qt' bot = Bot(True, console_qr= True)

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/util.py", line 144, in _validate_timeout float(value) TypeError: float() argument must be a string or a number, not 'tuple'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/itchat/components/login.py", line 231, in maintain_loop i = sync_check(self) File "/usr/local/lib/python3.4/dist-packages/itchat/components/login.py", line 283, in sync_check r = self.s.get(url, params=params, headers=headers) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 467, in get return self.request('GET', url, kwargs) File "/usr/local/lib/python3.4/dist-packages/wxpy/utils/misc.py", line 351, in customized_request return requests.Session.request(session, method, url, kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 455, in request resp = self.send(prep, send_kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 558, in send r = adapter.send(request, kwargs) File "/usr/lib/python3/dist-packages/requests/adapters.py", line 316, in send timeout = TimeoutSauce(connect=timeout, read=timeout) File "/usr/lib/python3/dist-packages/urllib3/util.py", line 116, in init self._connect = self._validate_timeout(connect, 'connect') File "/usr/lib/python3/dist-packages/urllib3/util.py", line 147, in _validate_timeout "int or float." % (name, value)) ValueError: Timeout value connect was (10, 30), but it must be an int or float.

youfou commented 7 years ago

需要更新 requests 和 urllib3 库的版本

prettybot commented 7 years ago

@youfou 服务器 requests (2.18.4) urllib3 (1.22) python(2.7.6) 仍然这个错误 本地requests (2.18.4) urllib3 (1.22) python(2.7.12) 就正常 服务器是ubutun 14.04 server版 本地是ubutun 16.05 桌面版

runzhliu commented 6 years ago

requests==2.1.0 可以跑起来