Search code examples
python-2.7seleniumtaurus

bzt 1.1.0 says DistributionNotFound: selenium


I just installed bzt 1.1.0 on my MacOSX but it won't run, it gives this message:

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

The thing is, selenium 2.49.2 was installed along with bzt. How can I fix this?


Solution

  • Turns out it was a Python package management issue. Selenium was installed in /Library/Python/2.7/site-packages with a selenium-2.49.2.dist-info directory, not the .egg-info directory that pkg_resources.py expected.

    Upgrading to a newer version of pkg_resources helped, as explained in this answer:

    sudo pip install --upgrade setuptools
    

    Then, reinstalling selenium finally fixed the problem:

    sudo pip uninstall selenium
    sudo pip install selenium
    

    Thanks to Andrey Pohilko on the Google Groups forum for helping out.