0

I'm a newbie to python, I've installed Luigi-2.0.1 on my RHEL linux. Trying to run a sample program

import luigi

class MyTask(luigi.Task) :
        param = luigi.Parameter(default=42)

        def requires(self):
                return SomeOtherTask(self.param)

        def run(self):
                f = self.output.open('w')
                print >>f, 'hello world'
                f.close()

        def output(self):
                return luigi.LocalTarget('/tmp/foo/bar-%s.txt' % self.param)

if __name__ == '__main__':
        luigi.run()

Executed the following command

luigi --module maintask.py MyTask

I get the following error.

Traceback (most recent call last):
  File "/usr/bin/luigi", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2655, in <module>
    working_set.require(__requires__)
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 648, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 546, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: python-daemon<3.0

Upon investigating the web, I could not figure out why this happened. I have python 2.6. Is it that luigi is not compatible with 2.6 and only works for python 3.0 onwards?.

Appreciate any help

Kevin
  • 74,910
  • 12
  • 133
  • 166
venBigData
  • 600
  • 1
  • 8
  • 23

1 Answers1

5

From Luigi's package page:

Luigi is a Python (2.7, 3.3, 3.4) package that helps you build complex pipelines of batch jobs.

You will have to upgrade from 2.6 if you want to use this.

Kevin
  • 74,910
  • 12
  • 133
  • 166
  • 1
    Thank you all for your inputs. I have python upgraded to 3.5. Luigi seems to have got installed based on the following response. $ luigi No task specified – venBigData Dec 28 '15 at 20:48