ImportError:在安装django-cms的情况下运行Django时没有名为cms的模块

时间:2015-03-17 21:43:43

标签: python django django-cms

我有一个基于django-cms的本地工作django项目。当我激活virtualenv source env/bin/activate和runserver python manage.py runserver时,突然它不再工作了,我得到了ImportError: No module named cms。 这里有完整的错误消息:

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 385, 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 354, in execute
    django.setup()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/__init__.py", line 21, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/apps/config.py", line 87, in create
    module = import_module(entry)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named cms

我不明白这一点,因为一切都很好,只有我2周前做的事情就是将项目所在的目录放在远离桌面的地方。 任何人都知道如何解决这个问题或者是什么原因。

点子列表:

argparse (1.3.0)
binaryornot (0.3.0)
cookiecutter (0.8.0)
coverage (3.7.1)
distribute (0.7.3)
dj-database-url (0.3.0)
Django (1.7.1)
django-allauth (0.18.0)
django-appconf (0.6)
django-autoslug (1.7.2)
django-avatar (2.0)
django-braces (1.4.0)
django-cache-url (0.8.0)
django-classy-tags (0.4)
django-configurations (0.8)
django-crispy-forms (1.4.0)
django-debug-toolbar (1.2.2)
django-extensions (1.4.9)
django-floppyforms (1.3.0)
django-front (0.4.3)
django-inplaceedit (1.3.0)
django-model-utils (2.2)
django-mptt (0.6.0)
django-reversion (1.8.0)
django-secure (1.0.1)
django-sekizai (0.7)
django-wymeditor (1.0)
djangocms-admin-style (0.2.0)
djangocms-installer (0.7.2)
djangocms-text-ckeditor (2.0.5)
docutils (0.12)
html5lib (1.0b1)
Jinja2 (2.7.3)
MarkupSafe (0.23)
mock (1.0.1)
MySQL-python (1.2.5)
oauthlib (0.7.2)
Pillow (2.6.1)
pip (1.5.6)
psycopg2 (2.5.4)
Pygments (2.0.1)
python-openid (2.2.5)
pytz (2013.8)
PyYAML (3.11)
requests (2.5.1)
requests-oauthlib (0.4.2)
setuptools (8.0)
six (1.4.1)
South (0.8.4)
Sphinx (1.2.3)
sqlparse (0.1.14)
unicode-slugify (0.1.1)
virtualenv (12.0.5)
waitress (0.8.9)
Werkzeug (0.9.6)
whitenoise (1.0.6)
wsgiref (0.1.2)

1 个答案:

答案 0 :(得分:2)

移动你的virtualenv会打破它,因为它使用绝对路径。如果您移动了包含virtualenv的文件夹,那么该路径将不再指向virtualenv的包。你需要将virtualenv放在原来的位置或制作一个新的virtualenv。