无法在 python 虚拟环境中导入名称 html Python
Cannot import name html Python on python virtual environment
这里需要一些帮助。我正在尝试 运行 我的 buildbot 框架,但我看到了这个错误。我在虚拟 python 环境 (pyenv) 中 运行 安装 buildbot 框架。当从虚拟环境 运行ning 时,有人可以帮助解决这个问题吗?
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)
谢谢
您似乎没有要导入的 "html" 模块。你是 运行 python 2.7。我尝试在我的 python 2.7 解释器中导入 "html" 模块,但它抛出了一个错误,因为它不是内置模块。您也可能是这种情况。不过,我能够导入 "html" 而 运行 我的 python 3.6 解释器。所以,如果可以的话,试试 运行 python 3.6 看看能不能带来好运。
这里需要一些帮助。我正在尝试 运行 我的 buildbot 框架,但我看到了这个错误。我在虚拟 python 环境 (pyenv) 中 运行 安装 buildbot 框架。当从虚拟环境 运行ning 时,有人可以帮助解决这个问题吗?
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)
谢谢
您似乎没有要导入的 "html" 模块。你是 运行 python 2.7。我尝试在我的 python 2.7 解释器中导入 "html" 模块,但它抛出了一个错误,因为它不是内置模块。您也可能是这种情况。不过,我能够导入 "html" 而 运行 我的 python 3.6 解释器。所以,如果可以的话,试试 运行 python 3.6 看看能不能带来好运。