Python:执行代码时出现Traceback错误

时间:2016-08-30 06:18:03

标签: python elementtree taurus

当我将代码作为bzt test.yml运行时,我收到了错误消息。 在它工作正常之前。

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

2 个答案:

答案 0 :(得分:0)

/bin/systemctl

你确定它不应该

ImportError: No module named elementtree.ElementTree

否则,请检查您是否安装了此依赖项,或者是否有&#34; elementtree&#34;当前项目中的文件夹,用于导入查找。

答案 1 :(得分:0)

听起来像丢失或损坏的lxml包裹给我。

解决方法包括:

  1. 试用Taurus Installer
  2. 通过pip重新安装lxml和/或bzt个软件包。
  3. 退房:

    如果问题仍然存在,请使用 bzt.log 文件内容更新您的问题。