Search code examples
pythonelementtreetaurus

Python: Getting Traceback error while executing the code


When I run the code as bzt test.yml I am getting the error. Before it was working fine.

C:\etc\tmp\my-test>more test.yml
---
execution:
   concurrency: 50
   hold-for: 2m30s
   ramp-up: 1m
   scenario:
      requests:
         - url: http://server12:12012/

    C:\etc\tmp\my-test>bzt test.yml
        Traceback (most recent call last):
          File "C:\Python27\Scripts\bzt-script.py", line 9, in <module>
            load_entry_point('bzt==1.6.7', 'console_scripts', 'bzt')()
          File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 564, in load_entry_point
            return get_distribution(dist).load_entry_point(group, name)
          File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 2621, in load_entry_point
            return ep.load()
          File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 2281, in load
            return self.resolve()
          File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 2287, in resolve
            module = __import__(self.module_name, fromlist=['__name__'], level=0)
          File "c:\python27\lib\site-packages\bzt\cli.py", line 32, in <module>
            from bzt.engine import Engine, Configuration, ScenarioExecutor
          File "c:\python27\lib\site-packages\bzt\engine.py", line 37, in <module>
            from bzt.six import build_opener, install_opener, urlopen, request, numeric_types, iteritems
          File "c:\python27\lib\site-packages\bzt\six\__init__.py", line 35, in <module>
            import elementtree.ElementTree as etree
        ImportError: No module named elementtree.ElementTree

Solution

  • Sounds like missing or corrupt lxml package to me.

    Workarounds are in:

    1. Try out Taurus Installer
    2. Reinstall lxml and/or bzt packages via pip.

    Check out:

    If the problem persists update your question with the bzt.log file contents.