-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError: No module named project.controllers.leads_fb #941
Comments
how can I add the import path for my worker.py file? I have tested and if I start the worker in the root directory with the command line 'rqworker' it works fine. My app thinks that the worker.py file is in the root directory, but it's actually in project/ inside the root directory. How and where do I specify this so it works locally and also deployed in Heroku? |
how can I add the import path for my worker.py file? I have tested and if I start the worker in the root directory with the command line 'rqworker' it works fine. My app thinks that the worker.py file is in the root directory, but it's actually in project/ inside the root directory. How and where do I specify this so it works locally and also deployed in Heroku? @nvie I have searched rq's documentation and I can't find it! please help. |
You can call the |
@selwin I am calling the worker this way: rq worker --path project/ |
@mateocam it is just regular python sys path module import stuff. you just have to run it from correct directory or install your package to system libraries. |
Hello !
I am having issues with the rq worker.
This is the structure of my app:
clock is executed once I run my app and this is the code:
then clock enqueues jobs with the rq worker which is worker.py:
and the function that the queued job is execution is controllers/leads_fb.py:
when I run my app with the run.py file in the root directory it gives me the error: ImportError: No module named project.controllers.leads_fb
my run.py file has this code:
and my app/project/init.py file has this
Please help!! I've been stuck with this for a week and can't manage to fix this. I have read other thread issues and have come to understand it has to do something with the PYTHONPATH that points my module directory to my rq worker but I have no idea how to implement this. @selwin
The text was updated successfully, but these errors were encountered: