社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  Redis

redis/rq工人在python3上断裂

user10680549 • 6 年前 • 1541 次点击  

所以我在RQ Worker中执行代码时出错

 File "/usr/local/bin/rq", line 11, in <module>
   sys.exit(main())
 File "/usr/local/lib/python3.7/site-packages/click/core.py", line 764, in __call__
   return self.main(*args, **kwargs)
 File "/usr/local/lib/python3.7/site-packages/click/core.py", line 717, in main
   rv = self.invoke(ctx)
 File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
   return _process_result(sub_ctx.command.invoke(sub_ctx))
 File "/usr/local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
   return ctx.invoke(self.callback, **ctx.params)
 File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
   return callback(*args, **kwargs)
 File "/usr/local/lib/python3.7/site-packages/rq/cli/cli.py", line 75, in wrapper
   return ctx.invoke(func, cli_config, *args[1:], **kwargs)
 File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
   return callback(*args, **kwargs)
 File "/usr/local/lib/python3.7/site-packages/rq/cli/cli.py", line 236, in worker
   worker.work(burst=burst, logging_level=logging_level)
 File "/usr/local/lib/python3.7/site-packages/rq/worker.py", line 493, in work
   self.execute_job(job, queue)
 File "/usr/local/lib/python3.7/site-packages/rq/worker.py", line 662, in execute_job
   self.fork_work_horse(job, queue)
 File "/usr/local/lib/python3.7/site-packages/rq/worker.py", line 599, in fork_work_horse
   self.main_work_horse(job, queue)
 File "/usr/local/lib/python3.7/site-packages/rq/worker.py", line 677, in main_work_horse
   success = self.perform_job(job, queue)
 File "/usr/local/lib/python3.7/site-packages/rq/worker.py", line 781, in perform_job
   self.prepare_job_execution(job)
 File "/usr/local/lib/python3.7/site-packages/rq/worker.py", line 706, in prepare_job_execution
   registry.add(job, timeout, pipeline=pipeline)
 File "/usr/local/lib/python3.7/site-packages/rq/registry.py", line 47, in add
   return pipeline.zadd(self.key, score, job.id)
 File "/usr/local/lib/python3.7/site-packages/redis/client.py", line 2263, in zadd
   for pair in iteritems(mapping):
 File "/usr/local/lib/python3.7/site-packages/redis/_compat.py", line 123, in iteritems
return iter(x.items())

AttributeError: 'int' object has no attribute 'items'
14:04:29 Moving job to 'failed' queue (work-horse terminated unexpectedly; waitpid returned 256)

我尝试在Openshift上的分离容器中运行此代码。相同的图像在本地工作。我想唯一的区别是,当我在本地尝试时,我在系统上运行的是RQworker,而我的本地同时运行python 2和3,而openshift只运行python3。

有人能解释为什么它开始这样做吗?我怀疑是因为python版本。但我不知道怎么跑 redis/ rq worker 用Python 2。

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/37901
 
1541 次点击  
文章 [ 1 ]  |  最新文章 6 年前