Search code examples
pythonpython-2.7buildbotpyenv

Cannot import name html Python on python virtual environment


Need some help over here. I am trying to run my buildbot framework and I am seeing this error. I am running the buildbot framework in the virtual python environment(pyenv). Can someone help with this or has seen this error when running from a virtual environment ?

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)

Thanks


Solution

  • It looks like you do not have the "html" module to import. You are running python 2.7. I tried importing the "html" module in my python 2.7 interpreter and it threw an error because it is not a built-in module. This may be the case for you, as well. I was able to import "html" while running my python 3.6 interpreter, though. So, if you can, try running python 3.6 and see if that brings any luck.