Python 2.7 断言错误:导入测试库';对话';失败:导入错误:没有名为\u tkinter的模块

Python 2.7 断言错误:导入测试库';对话';失败:导入错误:没有名为\u tkinter的模块,python-2.7,tkinter,plone,robotframework,Python 2.7,Tkinter,Plone,Robotframework,我正在尝试使用我在中发现的以下内容,在我的Plone加载项包上调试Robot框架测试: ***设置*** 资源plone/app/robotframework/keywords.robot ***测试用例*** 包含Pause关键字的暂停测试 暂停 运行测试时,将显示以下错误: Failure in test Test Locking Behavior (test_locking_behavior.robot) Traceback (most recent call last): File

我正在尝试使用我在中发现的以下内容,在我的Plone加载项包上调试Robot框架测试:

***设置***
资源plone/app/robotframework/keywords.robot
***测试用例***
包含Pause关键字的暂停测试
暂停
运行测试时,将显示以下错误:

Failure in test Test Locking Behavior (test_locking_behavior.robot)
Traceback (most recent call last):
  File "/home/hvelarde/.buildout/eggs/unittest2-0.5.1-py2.7.egg/unittest2/case.py", line 340, in run
    testMethod()
  File "/home/hvelarde/.buildout/eggs/robotsuite-1.6.1-py2.7.egg/robotsuite/__init__.py", line 455, in runTest
    assert last_status == 'PASS', last_message
AssertionError: Importing test library 'Dialogs' failed: ImportError: No module named _tkinter
Traceback (most recent call last):
  File "/home/hvelarde/.buildout/eggs/robotframework-2.8.4-py2.7.egg/robot/libraries/Dialogs.py", line 38, in <module>
    from dialogs_py import MessageDialog, PassFailDialog, InputDialog, SelectionDialog
  File "/home/hvelarde/.buildout/eggs/robotframework-2.8.4-py2.7.egg/robot/libraries/dialogs_py.py", line 17, in <module>
    from Tkinter import (Tk, Toplevel, Frame, Listbox, Label, Button, Entry,
  File "/home/hvelarde/buildout.python/parts/opt/lib/python2.7/lib-tk/Tkinter.py", line 39, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
PYTHONPATH:
  /home/hvelarde/.buildout/eggs/robotframework-2.8.4-py2.7.egg/robot/libraries
  /home/hvelarde/.buildout/eggs/robotframework-2.8.4-py2.7.egg
  /home/hvelarde/.buildout/eggs/Plone-4.3.4-py2.7.egg
  /home/hvelarde/.buildout/eggs/Products.ATContentTypes-2.1.14-py2.7.egg/Products/ATContentTypes/thirdparty
  /home/hvelarde/.buildout/eggs/plone.app.upgrade-1.3.7-py2.7.egg
  /home/hvelarde/collective/nitf/src
    [ Message content over the limit has been removed. ]
  /home/hvelarde/collective/nitf/bin
  /home/hvelarde/buildout.python/python-2.7/lib/python27.zip
  /home/hvelarde/buildout.python/python-2.7/lib/python2.7
  /home/hvelarde/buildout.python/python-2.7/lib/python2.7/plat-linux2
  /home/hvelarde/buildout.python/python-2.7/lib/python2.7/lib-tk
  /home/hvelarde/buildout.python/python-2.7/lib/python2.7/lib-old
  /home/hvelarde/buildout.python/python-2.7/lib/python2.7/lib-dynload
  /home/hvelarde/buildout.python/parts/opt/lib/python2.7
  /home/hvelarde/buildout.python/parts/opt/lib/python2.7/plat-linux2
  /home/hvelarde/buildout.python/parts/opt/lib/python2.7/lib-tk
  /home/hvelarde/buildout.python/python-2.7/lib/python2.7/site-packages
  /home/hvelarde/buildout.python/parts/opt/lib/python2.7/site-packages/setuptools-2.2-py2.7.egg
  /home/hvelarde/buildout.python/parts/opt/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg
  /home/hvelarde/buildout.python/parts/opt/lib/python2.7/site-packages/Pillow-2.6.0-py2.7-linux-x86_64.egg
  /home/hvelarde/buildout.python/parts/opt/lib/python2.7/site-packages
  .
  /home/hvelarde/collective/nitf/parts/test

如何修复此问题?

我必须安装tk-dev包(在我的情况下,使用
sudo-apt-get-install-tk-dev
)并重新编译我在virtualenv上使用的Python

我在这里找到了答案: