无法在python虚拟环境中导入名称html Python

时间:2017-12-16 00:07:17

标签: python python-2.7 buildbot pyenv

需要一些帮助。我正在尝试运行我的buildbot框架,我看到了这个错误。我在虚拟python环境(pyenv)中运行buildbot框架。有人可以帮助解决此问题,或者在从虚拟环境运行时遇到此错误吗?

2017-12-15 15:44:46-0800 [-] Loading configuration from '/local/mnt/ott-bb/master/master.cfg'
2017-12-15 15:44:46-0800 [-] config.py:7: buildbot.worker_transition.DeprecatedWorkerModuleWarning: 'buildbot.buildslave' module is deprecated, use 'buildbot.worker' modul      e instead
2017-12-15 15:44:46-0800 [-] config.py:7: buildbot.worker_transition.DeprecatedWorkerNameWarning: buildbot.buildslave.BuildSlave was deprecated in Buildbot 0.9.0: Use Work      er instead.
2017-12-15 15:44:46-0800 [-] config.py:10: buildbot.worker_transition.DeprecatedWorkerNameWarning: buildbot.schedulers.forcesched.BuildslaveChoiceParameter was deprecated       in Buildbot 0.9.0: Use WorkerChoiceParameter instead.
2017-12-15 15:44:46-0800 [-] error while parsing config file:
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/twisted/python/threadpool.py", line 266, in <lambda>
      inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
    File "/usr/local/lib/python2.7/dist-packages/twisted/python/context.py", line 122, in callWithContext
      return self.currentContext().callWithContext(ctx, func, *args, **kw)
    File "/usr/local/lib/python2.7/dist-packages/twisted/python/context.py", line 85, in callWithContext
      return func(*args,**kw)
    File "/usr/local/lib/python2.7/dist-packages/buildbot/config.py", line 182, in loadConfig
      self.basedir, self.configFileName)
  --- <exception caught here> ---
    File "/usr/local/lib/python2.7/dist-packages/buildbot/config.py", line 140, in loadConfigDict
      execfile(filename, localDict)
    File "/usr/local/lib/python2.7/dist-packages/twisted/python/compat.py", line 246, in execfile
      exec(code, globals, locals)
    File "/local/mnt/ott-bb/master/master.cfg", line 7, in <module>
      from config import *
    File "config.py", line 16, in <module>
      from buildbot.status import html
  exceptions.ImportError: cannot import name html

2017-12-15 15:44:46-0800 [-] Configuration Errors:
2017-12-15 15:44:46-0800 [-]   error while parsing config file: cannot import name html (traceback in logfile)

由于

1 个答案:

答案 0 :(得分:0)

看起来你没有&#34; html&#34;要导入的模块。您正在运行python 2.7。我尝试导入&#34; html&#34;我的python 2.7解释器中的模块因为它不是内置模块而引发错误。这也可能是你的情况。我能够导入&#34; html&#34;但是,在运行我的python 3.6解释器时。所以,如果可以,尝试运行python 3.6,看看是否带来任何好运。