Giter VIP home page Giter VIP logo

Comments (12)

liuliqiang avatar liuliqiang commented on August 11, 2024

ok, would you mind try execute python command to enter python dynamic interpreter enviroment, and then input:

import redis

from redisbeat.

elsagong avatar elsagong commented on August 11, 2024

Yes, I input import redis via python dynamic interpreter environment, it pause for keyboard input >>>

from redisbeat.

liuliqiang avatar liuliqiang commented on August 11, 2024

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.

elsagong avatar elsagong commented on August 11, 2024

我看到你在深圳,原谅我发中文了哦,你是让我贴出所有的报错吗?这个是安装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.

liuliqiang avatar liuliqiang commented on August 11, 2024

如果不介意的话,把直接在命令行敲 python 命令的所有输出也贴一下,谢谢。

from redisbeat.

elsagong avatar elsagong commented on August 11, 2024

您最后一句的意思是让我也贴出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.

liuliqiang avatar liuliqiang commented on August 11, 2024

问题很显然,你的环境管理没做好,你的 redis 是安装在 Python2 下面,而执行 Celery 是在 Python3 环境下面,至于怎么解决这个问题,搜索引擎可以帮助到你。

from redisbeat.

elsagong avatar elsagong commented on August 11, 2024

好的,谢谢你。

from redisbeat.

elsagong avatar elsagong commented on August 11, 2024

嗨,抱歉不得不再次打扰,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.

liuliqiang avatar liuliqiang commented on August 11, 2024

这个提示也很明显。。

请确认你本地的 redis 是起来的。。最简单的方法就是:redis-cli

from redisbeat.

elsagong avatar elsagong commented on August 11, 2024

您好,再次麻烦您,我输入redis-cli后,它提示的连接拒绝。。。

`Could not connect to Redis at 127.0.0.1:6379: Connection refused

not connected>`

from redisbeat.

elsagong avatar elsagong commented on August 11, 2024

哈哈,这样的问题原来网络上有很多,搜索到了,请忽略我,再次感谢

from redisbeat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.