无法运行manage.py runserver而无法运行

时间:2014-04-10 01:48:20

标签: python django python-2.7

我在本地方框上使用预先打包的默认python轻量级服务器来运行我的应用程序,但是无法正常运行服务器 - 当我运行python manage.py runserver

我得到以下输出。

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
    utility.execute()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 263, in fetch_command
    app_name = get_commands()[subcommand]
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 109, in get_commands
    apps = settings.INSTALLED_APPS
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py", line 53, in __getattr__
    self._setup(name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in _setup
    self._wrapped = Settings(settings_module)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py", line 134, in __init__
    raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'myapp.settings' (Is it on sys.path?): dlopen(/Library/Python/2.7/site-packages/greenlet.so, 2): Symbol not found: __PyTrash_thread_deposit_object
  Referenced from: /Library/Python/2.7/site-packages/greenlet.so
  Expected in: flat namespace
 in /Library/Python/2.7/site-packages/greenlet.so

manage.py包含:

#!/usr/bin/env python
import os
import sys

if __name__ == "__main__":
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myapp.settings")

    from django.core.management import execute_from_command_line

    execute_from_command_line(sys.argv)

我也尝试过跑步:

>>> import sys
>>> for path in sys.path: print path

这会在OSX的终端

中抛出Segmentation fault: 11

我已经验证了myapp.settings的路径包含在eclipse-&gt; pydev的python路径中。

任何?

谢谢

0 个答案:

没有答案