First time here? Check out the FAQ!

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

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 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\", line 240, in trace_task R = retval = fun(*args, **kwargs) 
File "D:\SVNRepo\projects-sw\EVE_ESI\trunk\env\src\app_web\extensions\", line 32, in __call__ return TaskBase.__call__(self, *args, **kwargs) 
File "d:\svnrepo\projects-sw\eve_esi\trunk\env\lib\site-packages\celery\app\", line 438, in __protected_call__ return*args, **kwargs) 
File "D:\SVNRepo\projects-sw\EVE_ESI\trunk\env\src\app_web\tasks\", line 57, in update_trader import wingdbstubModuleNotFoundError: No module named 'wingdbstub'

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

Eric Earnst's avatar
Eric Earnst
asked 2017-09-17 22:05:00 -0500
Wingware Support's avatar
Wingware Support
updated 2019-03-13 10:14:17 -0500
edit flag offensive 0 remove flag close merge delete


add a comment see more comments

1 Answer


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.  If '' 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...

Wingware Support's avatar
Wingware Support
answered 2017-09-18 09:44:00 -0500
Wingware Admin's avatar
Wingware Admin
updated 2019-03-07 07:31:49 -0500
edit flag offensive 0 remove flag delete link


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 in that location and life is good again.  And I cleaned up all the other wingdbstubs :)

Eric Earnst's avatar Eric Earnst (2017-09-18 23:35:00 -0500) edit
add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer