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

问题描述 投票:0回答:1

需要一些帮助。我正在尝试运行我的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)

谢谢

python python-2.7 buildbot pyenv
1个回答
0
投票

看起来您没有要导入的“html”模块。您正在运行python 2.7。我尝试在我的python 2.7解释器中导入“html”模块并且它引发了一个错误,因为它不是内置模块。这也可能是你的情况。不过,我可以在运行python 3.6解释器时导入“html”。所以,如果可以,尝试运行python 3.6,看看是否带来任何好运。

© www.soinside.com 2019 - 2024. All rights reserved.