Another Celery remote debug issue, not working in a periodic task


153
views
1
12 weeks ago by
I am trying to debug a tasks that was fired by celery beat and put in import wingdbstub in the task code.  The task fires and Celery responds but I get ModuleNotFoundError("No module named 'wingdbstub'",) when it hits import wingdbstub.  I have wingdbstub.py in every directory mentioned in the traceback at this point and in \celery and\celery\bin and it still isn't found.  It is working fine in the main celery code in site-packages when I look at other issues.  Any ideas where it might be looking?

[2017-09-16 20:21:36,213: INFO/MainProcess] Connected to sqla+sqlite:///tasks.sqlite
[2017-09-16 20:21:36,260: WARNING/MainProcess] celery@Eric-PC ready.
[2017-09-16 20:21:43,729: INFO/MainProcess] Received task: tasks.update_trader[7bc0b86f-561e-4638-807f-48149fde6efa][2017-09-16 20:21:43,744: INFO/MainProcess] **** update_trader
[2017-09-16 20:21:43,744: ERROR/MainProcess] Task tasks.update_trader[7bc0b86f-561e-4638-807f-48149fde6efa] raised unexpected: ModuleNotFoundError("No module named wingdbstub'",)
Traceback (most recent call last):
File "d:\svnrepo\projects-sw\eve_esi\trunk\env\lib\site-packages\celery\app\trace.py", line 240, in trace_task
R = retval = fun(*args, **kwargs)
File "D:\SVNRepo\projects-sw\EVE_ESI\trunk\env\src\app_web\extensions\celery_app.py", line 32, in __call__
return TaskBase.__call__(self, *args, **kwargs)
File "d:\svnrepo\projects-sw\eve_esi\trunk\env\lib\site-packages\celery\app\trace.py", line 438, in __protected_call__
return self.run(*args, **kwargs)
File "D:\SVNRepo\projects-sw\EVE_ESI\trunk\env\src\app_web\tasks\tasks.py", line 57, in update_trader
import wingdbstub
ModuleNotFoundError: No module named 'wingdbstub'

This is on Win 7/64 with Python 3.6.2 and the latest Wing Pro.


Community: Wing Python IDE

1 Answer


3
12 weeks ago by
I don't know the internals of celery but you can see all the directories it'll try to import from by printing sys.path (after 'import sys') on the line before the import of wingdbstub.  It '' or '.' is not on the sys.path then it won't look in the current directory.  If it is, it'll also look in the directory given by os.getcwd().

Probably best to sort this out and just have one copy of wingdbstub...
Should have remembered sys.path, since this is fired by celery.exe in the Scripts folder (in an Anaconda env) that was the first entry and the rest weren't particularly useful for this problem.  I added '.' and put wingdbstub.py in that location and life is good again.  And I cleaned up all the other wingdbstubs :)
written 12 weeks ago by Eric Earnst  
Please login to add an answer/comment or follow this question.

Similar posts:
Search »