0

我正在尝试运行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

我已经使用 command 安装了轨道pip install orbited。我尝试更改pyorbited.simpleorbited.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
4

1 回答 1

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
>>>
于 2014-05-18T02:51:00.473 回答