Take the examples
directory in the luigi
repository (git clone ...
and you have the luigi
directory). There you can find a few different examples, among them:
hello_world.py
contains stuff like task_namespace = 'examples'
(that's the same as the python module examples
in the repository where all these python files are saved):
- this could be executed using just the
luigi
command (no need to have the daemon luigid
) from the outside of the python module examples
as: cd luigi && PYTHONPATH=. luigi --module examples.hello_world examples.HelloWorldTask --local-scheduler
top_artists.py
does not contain any reference to things like task_namespace
:
- this could be run from within the python module
examples
: cd luigi/examples && PYTHONPATH='.' luigi --module top_artists AggregateArtists --local-scheduler --date-interval 2012-06
This worked for me using miniconda (similar to anaconda) and cygwin, but I think it could work even if you don't use cygwin (maybe powershell
or cmd
don't allow you to concatenate commands using &&
but you can always run those commands one after the other).
I am not sure of the reasons/explanations, but to troubleshoot a bit this behaviour you could play with hello_world.py
and run it as cd luigi/examples && PYTHONPATH=. luigi --module hello_world HelloWorldTask --local-scheduler
(please note that the luigi
command is invoked without examples.
as the prefix for the command parameters), this will give the following exception:
raise TaskClassNotFoundException(cls._missing_task_msg(name))
luigi.task_register.TaskClassNotFoundException: No task HelloWorldTask. Candidates are: Config,ExternalTask,RangeBase,RangeByMinutes,RangeByMinutesBase,RangeDaily,RangeDailyBase,RangeHourly,RangeHourlyBase,Task,TestNotificationsTask,WrapperTask,batch_email,core,email,examples.HelloWorldTask,execution_summary,retcode,scheduler,sendgrid,smtp,worker
To give some hints to the other issue you have with the daemon, I start it on cygwin with a command like this: luigid &
. That ampersand suffix gives you back the command line prompt. To check which PID is associated to the daemon then I still use the same command line prompt on cygwin and I run ps aux | grep luigid
. This approach probably will work ONLY on cygwin (because of some bash related internals).