我是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, 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
在调查网络时,我无法弄清楚为什么会这样。我有python 2.6。这是luigi与2.6兼容并且仅适用于python 3.0以上吗?
感谢任何帮助
答案 0 :(得分:5)