Comments (12)
ok, would you mind try execute python
command to enter python dynamic interpreter enviroment, and then input:
import redis
from redisbeat.
Yes, I input import redis
via python dynamic interpreter environment, it pause for keyboard input >>>
from redisbeat.
It seems your redis library install is ok,would you mind show all the output of command for celery worker -A tasks -l info
and the all output of command python
for your environment?
from redisbeat.
我看到你在深圳,原谅我发中文了哦,你是让我贴出所有的报错吗?这个是安装redis包后在/example路径下输入celery worker -A tasks -l
```
Traceback (most recent call last):
File "/usr/bin/celery", line 26, in
load_entry_point("celery", "console_scripts", "celery")()
File "/usr/lib/python3/dist-packages/celery/main.py", line 30, in main
main()
File "/usr/lib/python3/dist-packages/celery/bin/celery.py", line 81, in main
cmd.execute_from_commandline(argv)
File "/usr/lib/python3/dist-packages/celery/bin/celery.py", line 770, in execute_from_commandline
super(CeleryCommand, self).execute_from_commandline(argv)))
File "/usr/lib/python3/dist-packages/celery/bin/base.py", line 311, in execute_from_commandline
return self.handle_argv(self.prog_name, argv[1:])
File "/usr/lib/python3/dist-packages/celery/bin/celery.py", line 762, in handle_argv
return self.execute(command, argv)
File "/usr/lib/python3/dist-packages/celery/bin/celery.py", line 694, in execute
).run_from_argv(self.prog_name, argv[1:], command=argv[0])
File "/usr/lib/python3/dist-packages/celery/bin/worker.py", line 179, in run_from_argv
return self(*args, **options)
File "/usr/lib/python3/dist-packages/celery/bin/base.py", line 274, in call
ret = self.run(*args, **kwargs)
File "/usr/lib/python3/dist-packages/celery/bin/worker.py", line 212, in run
state_db=self.node_format(state_db, hostname), **kwargs
File "/usr/lib/python3/dist-packages/celery/worker/init.py", line 100, in init
self.setup_instance(**self.prepare_args(**kwargs))
File "/usr/lib/python3/dist-packages/celery/worker/init.py", line 126, in setup_instance
self.should_use_eventloop() if use_eventloop is None
File "/usr/lib/python3/dist-packages/celery/worker/init.py", line 245, in should_use_eventloop
self._conninfo.is_evented and not self.app.IS_WINDOWS)
File "/usr/lib/python3/dist-packages/kombu/connection.py", line 819, in is_evented
return self.transport.supports_ev
File "/usr/lib/python3/dist-packages/kombu/connection.py", line 769, in transport
self._transport = self.create_transport()
File "/usr/lib/python3/dist-packages/kombu/connection.py", line 514, in create_transport
return self.get_transport_cls()(client=self)
File "/usr/lib/python3/dist-packages/kombu/transport/redis.py", line 950, in init
raise ImportError('Missing redis library (pip install redis)')
ImportError: Missing redis library (pip install redis)`
from redisbeat.
如果不介意的话,把直接在命令行敲 python
命令的所有输出也贴一下,谢谢。
from redisbeat.
您最后一句的意思是让我也贴出python的报错吗?
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import redis
>>> celery worker -A tasks -l info
File "<stdin>", line 1
celery worker -A tasks -l info
^
SyntaxError: invalid syntax
from redisbeat.
问题很显然,你的环境管理没做好,你的 redis 是安装在 Python2 下面,而执行 Celery 是在 Python3 环境下面,至于怎么解决这个问题,搜索引擎可以帮助到你。
from redisbeat.
好的,谢谢你。
from redisbeat.
嗨,抱歉不得不再次打扰,python3环境下已安装redis,在命令行输入 celery worker -A tasks -l
后,还是没有成功启动celery worker.................就是一直重复显示红色字体 [2018-01-25 10:31:54,168: ERROR/MainProcess] consumer: Cannot connect to redis://localhost:6379//: . Trying again in 2.00 seconds...
-------------- celery@gh-pc v3.1.20 (Cipater)
---- **** -----
--- * *** * -- Linux-4.13.0-26-generic-x86_64-with-Ubuntu-16.04-xenial
-- * - **** ---
- ** ---------- [config]
- ** ---------- .> app: tasks:0x7f48aa11af60
- ** ---------- .> transport: redis://localhost:6379//
- ** ---------- .> results: redis://localhost:6379/
- *** --- * --- .> concurrency: 1 (prefork)
-- ******* ----
--- ***** ----- [queues]
-------------- .> celery exchange=celery(direct) key=celery
[tasks]
. tasks.add
. tasks.sub
[2018-01-25 10:31:54,168: ERROR/MainProcess] consumer: Cannot connect to redis://localhost:6379//: .
Trying again in 2.00 seconds...
from redisbeat.
这个提示也很明显。。
请确认你本地的 redis 是起来的。。最简单的方法就是:redis-cli
from redisbeat.
您好,再次麻烦您,我输入redis-cli后,它提示的连接拒绝。。。
`Could not connect to Redis at 127.0.0.1:6379: Connection refused
not connected>`
from redisbeat.
哈哈,这样的问题原来网络上有很多,搜索到了,请忽略我,再次感谢
from redisbeat.
Related Issues (20)
- 请问celery如何动态创建task? HOT 6
- Remote Redis HOT 3
- "remove" seems doesn't work HOT 3
- redisbeat 1.1.0 does not have the latest changes for python3 HOT 3
- CELERY_REDIS_SCHEDULER_URL with password is not working HOT 2
- Can't see current schedule on INFO HOT 9
- Add a docker-compose demo HOT 8
- Support for redis sentinel HOT 2
- Add support for PeriodicTask tasks
- AttributeError: 'crontab' object has no attribute 'human_seconds' HOT 2
- each time init RedisScheduler - repeated call HOT 2
- 新增task 问题 HOT 1
- [feature] functionality to execute the task as django-celery-beat does: HOT 2
- How to setup an Timzone properly?
- Problematic dependency on jsonpickle==1.2 HOT 2
- 第80行的task为bytes类型 HOT 2
- version 1.2.5 is broken HOT 2
- jsonpickle issues parsing datetime HOT 2
- Hi, I encountered the following error while using this framework. Could you please advise on how to resolve it? My Redis is in cluster mode. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redisbeat.