kombu.exceptions.VersionMismatch: Redis transport requires redis-py versions 3.2.0 or later. You have 2.10.6问题
问题:
(env) D:\python_learn\meiduo_project\meiduo_mall>celery -A celery_tasks.main worker -l info -------------- celery@CZZI-BBMGSW v4.4.7 (cliffs) --- ***** ----- -- ******* ---- Windows-7-6.1.7601-SP1 2020-08-11 19:54:42 - *** --- * --- - ** ---------- [config] - ** ---------- .> app: meiduo:0x3765fa0 - ** ---------- .> transport: redis://localhost:6379/7 - ** ---------- .> results: disabled:// - *** --- * --- .> concurrency: 4 (prefork) -- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker) --- ***** ----- -------------- [queues] .> celery exchange=celery(direct) key=celery [tasks] . ccp_send_sms_code . send_verify_email . sku_static_html [2020-08-11 19:54:42,213: CRITICAL/MainProcess] Unrecoverable error: VersionMismatch('Redis transport requires redis-py versions 3.2.0 or later. You have 2.10.6') Traceback (most recent call last): File "d:\python_learn\meiduo_project\env\lib\site-packages\kombu\transport\virtual\base.py", line 921, in create_channel return self._avail_channels.pop() IndexError: pop from empty list During handling of the above exception, another exception occurred: Traceback (most recent call last): File "d:\python_learn\meiduo_project\env\lib\site-packages\celery\worker\worker.py", line 208, in start self.blueprint.start(self) File "d:\python_learn\meiduo_project\env\lib\site-packages\celery\bootsteps.py", line 119, in start step.start(parent) File "d:\python_learn\meiduo_project\env\lib\site-packages\celery\bootsteps.py", line 369, in start return self.obj.start() File "d:\python_learn\meiduo_project\env\lib\site-packages\celery\worker\consumer\consumer.py", line 318, in start blueprint.start(self) File "d:\python_learn\meiduo_project\env\lib\site-packages\celery\bootsteps.py", line 119, in start step.start(parent) File "d:\python_learn\meiduo_project\env\lib\site-packages\celery\worker\consumer\connection.py", line 23, in start c.connection = c.connect() File "d:\python_learn\meiduo_project\env\lib\site-packages\celery\worker\consumer\consumer.py", line 405, in connect conn = self.connection_for_read(heartbeat=self.amqheartbeat) File "d:\python_learn\meiduo_project\env\lib\site-packages\celery\worker\consumer\consumer.py", line 411, in connection_for_read return self.ensure_connected( File "d:\python_learn\meiduo_project\env\lib\site-packages\celery\worker\consumer\consumer.py", line 437, in ensure_connected conn = conn.ensure_connection( File "d:\python_learn\meiduo_project\env\lib\site-packages\kombu\connection.py", line 389, in ensure_connection self._ensure_connection(*args, **kwargs) File "d:\python_learn\meiduo_project\env\lib\site-packages\kombu\connection.py", line 441, in _ensure_connection return retry_over_time( File "d:\python_learn\meiduo_project\env\lib\site-packages\kombu\utils\functional.py", line 344, in retry_over_time return fun(*args, **kwargs) File "d:\python_learn\meiduo_project\env\lib\site-packages\kombu\connection.py", line 874, in _connection_factory self._connection = self._establish_connection() File "d:\python_learn\meiduo_project\env\lib\site-packages\kombu\connection.py", line 809, in _establish_connection conn = self.transport.establish_connection() File "d:\python_learn\meiduo_project\env\lib\site-packages\kombu\transport\virtual\base.py", line 941, in establish_connection self._avail_channels.append(self.create_channel(self)) File "d:\python_learn\meiduo_project\env\lib\site-packages\kombu\transport\virtual\base.py", line 923, in create_channel channel = self.Channel(connection) File "d:\python_learn\meiduo_project\env\lib\site-packages\kombu\transport\redis.py", line 505, in __init__ self.Client = self._get_client() File "d:\python_learn\meiduo_project\env\lib\site-packages\kombu\transport\redis.py", line 978, in _get_client raise VersionMismatch( kombu.exceptions.VersionMismatch: Redis transport requires redis-py versions 3.2.0 or later. You have 2.10.6 [2020-08-11 19:54:42,483: INFO/SpawnPoolWorker-1] child process 8884 calling self.run() [2020-08-11 19:54:42,488: INFO/SpawnPoolWorker-2] child process 9120 calling self.run() [2020-08-11 19:54:42,562: INFO/SpawnPoolWorker-4] child process 7884 calling self.run() [2020-08-11 19:54:42,579: INFO/SpawnPoolWorker-3] child process 9036 calling self.run()
升级redis到最新版本问题解决:
pip install redis
壬戌之秋,七月既望,苏子与客泛舟游于赤壁之下。清风徐来,水波不兴。举酒属客,诵明月之诗,歌窈窕之章。少焉,月出于东山之上,徘徊于斗牛之间。白露横江,水光接天。纵一苇之所如,凌万顷之茫然。浩浩乎如冯虚御风,而不知其所止;飘飘乎如遗世独立,羽化而登仙。
于是饮酒乐甚,扣舷而歌之。歌曰:“桂棹兮兰桨,击空明兮溯流光。渺渺兮予怀,望美人兮天一方。”客有吹洞箫者,倚歌而和之。其声呜呜然,如怨如慕,如泣如诉,余音袅袅,不绝如缕。舞幽壑之潜蛟,泣孤舟之嫠妇。
苏子愀然,正襟危坐而问客曰:“何为其然也?”客曰:“月明星稀,乌鹊南飞,此非曹孟德之诗乎?西望夏口,东望武昌,山川相缪,郁乎苍苍,此非孟德之困于周郎者乎?方其破荆州,下江陵,顺流而东也,舳舻千里,旌旗蔽空,酾酒临江,横槊赋诗,固一世之雄也,而今安在哉?况吾与子渔樵于江渚之上,侣鱼虾而友麋鹿,驾一叶之扁舟,举匏樽以相属。寄蜉蝣于天地,渺沧海之一粟。哀吾生之须臾,羡长江之无穷。挟飞仙以遨游,抱明月而长终。知不可乎骤得,托遗响于悲风。”
苏子曰:“客亦知夫水与月乎?逝者如斯,而未尝往也;盈虚者如彼,而卒莫消长也。盖将自其变者而观之,则天地曾不能以一瞬;自其不变者而观之,则物与我皆无尽也,而又何羡乎!且夫天地之间,物各有主,苟非吾之所有,虽一毫而莫取。惟江上之清风,与山间之明月,耳得之而为声,目遇之而成色,取之无禁,用之不竭,是造物者之无尽藏也,而吾与子之所共适。”
客喜而笑,洗盏更酌。肴核既尽,杯盘狼籍。相与枕藉乎舟中,不知东方之既白。