how use server-celery with flask
Question: I installed celery-server 3.0.0 to flask and then I started the server, but
when I used the server to run a python code backgroud I find this error.

> ~/Bureau$ sudo python exme.py  
>  Traceback (most recent call last):  
>  File "exme.py", line 2, in  
>  from celery import Celery  
>  ImportError: No module named celery  
>
    
    
    from flask import Flask
    from celery import Celery
    app = Flask(__name__)
    app.config.update(
    CELERY_BROKER_URL='redis://localhost:6379',
    CELERY_RESULT_BACKEND='redis://localhost:6379'
    )
    celery = Celery(app.name, broker=app.config['CELERY_BROKER_URL'])
    celery.conf.update(app.config)
    @celery.task() 
    def add_together(a, b):
        return a + b
    @APP.route('/test',methods=['POST'])
    def test():
     try:
       result=add_together.delay(5,2) 
       return result
     except Exception as e: 
    
        return e
    


Answer: You probably don't need to use `sudo` to run your app. When you use `sudo`,
your environment variables are not carried over and you loose your virtualenv.
Run your app like this instead:

    
    
    $ python exme.py
    

