我正在为Django模板运行pyjade,因为我发现它写起来要容易得多,但是我正在尝试使用内置的转换器将其转换为html。当我运行pyjade -c django input.jade output.html时,出现错误pkg_resources.DistributionNotFound: six。但是,实际上six包确实存在,我可以在python上导入它,当我运行pip install six --upgrade时,它说它已经是最新的了。

这是完整的回溯:

Traceback (most recent call last):
  File "/usr/local/bin/pyjade", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2707, in <module>
    working_set.require(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 686, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 584, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: six

是什么导致此错误?

最佳答案

通过easy_setup(vs pip)重新安装为我在OS X Mavericks上解决了问题:
sudo easy_install six
希望对您有所帮助!

10-08 18:12