bzt 1.1.0说DistributionNotFound:selenium

时间:2016-01-27 23:10:20

标签: python-2.7 selenium taurus

我刚刚在我的MacOSX上安装了bzt 1.1.0,但它没有运行,它给出了这样的信息:

Traceback (most recent call last):
  File "/usr/local/bin/bzt", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
    working_set.require(__requires__)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
    raise DistributionNotFound(req)  # XXX put more info here
pkg_resources.DistributionNotFound: selenium
事实是,硒2.49.2与bzt一起安装。我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

原来这是一个Python包管理问题。 Selenium安装在带有selenium-2.49.2.dist-info目录的/Library/Python/2.7/site-packages中,而不是.egg-info预期的pkg_resources.py目录。

升级到较新版本的pkg_resources有帮助,如this answer中所述:

sudo pip install --upgrade setuptools

然后,重新安装selenium最终解决了问题:

sudo pip uninstall selenium
sudo pip install selenium

感谢安德烈·波希尔科在Google Groups forum寻求帮助。