简体   繁体   English

在python 2.7中使用celery

[英]Use celery with python 2.7

It was working fine until I messed up my PATH enviroment variable. 在我弄乱PATH环境变量之前,它一直工作良好。 I did the following thing: 我做了以下事情:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"


echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

echo 'export PATH="/usr/local/opt/python/libexec/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

This pretty much installed homebrew python 3 and created entire havoc ... then now celery only listens to these. 这个几乎安装了自制python 3并创建了整个浩劫...然后,芹菜只听这些。 I just completely uninstalled python 3. Now I'm currently facing the following error: 我刚刚完全卸载了python3。现在,我目前面临以下错误:

-bash: /usr/local/bin/celery: /usr/local/opt/python3/bin/python3.6: bad interpreter: No such file or directory

When I do which python it gives me this directory: 当我执行哪个python时,它将给我以下目录:

/usr/bin/python

When I run python it's running 2.7 as expected. 当我运行python时,运行的是2.7。 However celery command seems to be throwing me that error. 但是celery命令似乎将我抛出该错误。 How do I revert back to my default state? 如何恢复到默认状态?

How did you install Celery? 您是如何安装Celery的? Did you use pip? 你用点子了吗? You may need to use whatever version of python does exist on your machine to reinstall pip, and use that pip to reinstall Celery. 您可能需要使用计算机上确实存在的任何版本的python重新安装pip,然后使用该pip重新安装Celery。

May be the package might not installed correctly. 可能是该软件包可能未正确安装。 so, uninstall if it's installed and reinstall again with below commands. 因此,请先卸载(如果已安装),然后使用以下命令重新安装。

pip uninstall celery
pip install celery

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

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