分享

horizon 运行run_tests.sh抛出

ruyang 发表于 2014-12-12 10:34:23 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 2 22907
求大神帮忙,我在horizon开发中,运行 run.tests.sh是报出以下错误请大神帮解。

======================================================================
ERROR: openstack_dashboard.test.test_data.utils.load_test_data
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kevin/openstack-dev/horizon/.venv/lib/python2.6/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/kevin/openstack-dev/horizon/openstack_dashboard/test/test_data/utils.py", line 19, in load_test_data
    from openstack_dashboard.test.test_data import cinder_data
  File "/home/kevin/openstack-dev/horizon/openstack_dashboard/test/test_data/cinder_data.py", line 22, in <module>
    from openstack_dashboard import api
  File "/home/kevin/openstack-dev/horizon/openstack_dashboard/api/__init__.py", line 36, in <module>
    from openstack_dashboard.api import base
ImportError: cannot import name base

======================================================================
ERROR: Failure: ImportError (cannot import name adapter)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kevin/openstack-dev/horizon/.venv/lib/python2.6/site-packages/nose/loader.py", line 414, in loadTestsFromName
    addr.filename, addr.module)
  File "/home/kevin/openstack-dev/horizon/.venv/lib/python2.6/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/home/kevin/openstack-dev/horizon/.venv/lib/python2.6/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/kevin/openstack-dev/horizon/openstack_dashboard/test/test_plugins/panel_group_tests.py", line 22, in <module>
    from openstack_dashboard.test import helpers as test
  File "/home/kevin/openstack-dev/horizon/openstack_dashboard/test/helpers.py", line 43, in <module>
    from troveclient import client as trove_client
  File "/home/kevin/openstack-dev/horizon/.venv/lib/python2.6/site-packages/troveclient/client.py", line 28, in <module>
    from keystoneclient import adapter
ImportError: cannot import name adapter

已有(2)人评论

跳转到指定楼层
desehawk 发表于 2014-12-12 11:30:34
检查下面两个地方:

1.查看是否有 .pyc 文件, .pyc 文件和py源码文件在同一个目录, pyton运行的时候会优先使用pyc文件, 所以有时你需要手动将之删除。

2.run.tests.sh这个是否你自定义文件,如果自定义不要与系统文件名冲突。

回复

使用道具 举报

ruyang 发表于 2014-12-12 12:09:41
问题已经解决了,是python-troveclient包的版本太高了,降了版本就Ok了。多谢版主
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条