I have a Django project, and I want to use Celery. I've installed Celery for python3, and then I run this command : sudo celery -A myApp worker -l info
But in the log, I see that it's Celery of python2.7 which is used : File "/Library/Python/2.7/site-packages
Any idea how for me to use the Celery installed for python3 ?
Ok, thanks to @Wayne I've found the solution.
First, use this command to see where the head of celery is : head -n 10 /usr/local/bin/celery
For myself, this is what I get :
#!/usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'celery==3.1.23','console_scripts','celery'
__requires__ = 'celery==3.1.23'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
load_entry_point('celery==3.1.23', 'console_scripts', 'celery')()
)
I see that the first shebang (#!/usr/bin/python) use the wrong python version.
Then, I've changed the first shebang : #!/usr/bin/env python3 and save the file. Now celery point to python3.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With