ImportError:运行django-orbited时没有名为pyorbited.simple的模块

时间:2013-11-30 15:24:10

标签: python django orbited

我正在尝试运行django-orbited的测试项目。执行python manage.py runserver时,会发生以下错误:

Unhandled exception in thread started by <bound method Command.inner_run of 
<django.core.management.commands.runserver.Command object at 0x8ea994c>>
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 92, in inner_run
    self.validate(display_num_errors=True)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 280, in validate
    num_errors = get_validation_errors(s, app)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/validation.py", line 35, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 166, in get_app_errors
    self._populate()
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 75, in _populate
    self.load_app(app_name)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 96, in load_app
    models = import_module('.models', app_name)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/prashant/grambox/django-orbited/testing/django_orbited/models.py", line 2, in <module>
    from pyorbited.simple import Client as OrbitedClient
ImportError: No module named pyorbited.simple

我已使用命令pip install orbited安装了轨道。我尝试将pyorbited.simple更改为orbited.simple,但错误仍然存​​在。有谁知道如何解决它?

sys.path中的值:

/usr/local/lib/python2.7/dist-packages/pip-1.2.1-py2.7.egg
/usr/local/lib/python2.7/dist-packages/jqmobile-1.0_pre_alpha-py2.7.egg
/usr/lib/python2.7
/usr/lib/python2.7/plat-linux2
/usr/lib/python2.7/lib-tk
/usr/lib/python2.7/lib-old
/usr/lib/python2.7/lib-dynload
/usr/local/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages/PIL
/usr/lib/python2.7/dist-packages/gst-0.10
/usr/lib/python2.7/dist-packages/gtk-2.0
/usr/lib/python2.7/dist-packages/ubuntu-sso-client
/usr/lib/python2.7/dist-packages/ubuntuone-client
/usr/lib/python2.7/dist-packages/ubuntuone-control-panel
/usr/lib/python2.7/dist-packages/ubuntuone-couch
/usr/lib/python2.7/dist-packages/ubuntuone-installer
/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol
/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode

1 个答案:

答案 0 :(得分:1)

您安装了orbited,但需要安装pyorbited

我只能安装orbited来重现同样的问题:

% sudo pip install orbited
% python
>>> import orbited        # yes, this works but it's not what you need
>>> from pyorbited.simple import Client as OrbitedClient
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pyorbited.simple

另一方面,一旦我们安装了pyorbited,它就会起作用:

% sudo pip install pyorbited
% python
>>> from pyorbited.simple import Client as OrbitedClient
>>>