简体   繁体   English

在python2,python3中同时安装命令行时如何使用命令行启动celery

[英]how to use command line to start celery when I install it both in python2,python3

I used celery + requests first in python2.7,and it works fine,but I heard celery + aiohttp is faster,so I test it in python3, and it really fast,but then I found I can't use celery to start my program write in python2.7,because there are changes between them ,I use command line to start celery only get errors I guess I should just uninstall the celery of python3? 我首先在python2.7中使用了celery +请求,并且工作正常,但是我听说celery + aiohttp更快,所以我在python3中对其进行了测试,而且确实非常快,但是后来我发现我无法使用celery启动我的程序写在python2.7中,因为它们之间有变化,我使用命令行启动celery只得到错误,我想我应该只卸载python3的celery吗? Is there a better way to do this? 有一个更好的方法吗? In fact,I guess since there are many package works for both p2,p3,and use commandline to start,there must have a good solution. 实际上,我想因为p2,p3都有很多软件包,并且使用命令行启动,所以必须有一个好的解决方案。

What you need is a virtual environment. 您需要的是虚拟环境。 A virtual environment encapsulates a Python install, along with all the pip packages And executable files such as celery. 虚拟环境封装了Python安装,所有pip包和可执行文件(如celery)。 check out the virtualenv and virtualenvwrapper Python packages. 查看virtualenv和virtualenvwrapper Python软件包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM