我是python的新手,我已经在我的RHEL linux上安装了Luigi-2.0.1.试图运行示例程序
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()
执行以下命令
luigi --module maintask.py MyTask
我收到以下错误.
Traceback (most recent call last): File "/usr/bin/luigi", line 5, infrom pkg_resources import load_entry_point File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2655, in 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
在调查网络时,我无法弄清楚为什么会这样.我有python 2.6.这是luigi与2.6兼容并且仅适用于python 3.0以上吗?
感谢任何帮助
来自Luigi的包装页面:
Luigi是一个Python(2.7,3.3,3.4)软件包,可帮助您构建批处理作业的复杂管道.
如果要使用此功能,则必须从2.6升级.