我正在进入一个继承的Django项目,所以我不能说它是如何设置的。但是,pip freeze
告诉我django-cms安装在virtualenv中:
(demo)$ pip freeze
...
django-cms==3.3.0
...
那么为什么当我对manage.py
做任何事情时,我会收到错误消息,说它不可用?
(演示)$
./manage.py shell
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/iscape/sites/demo/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
utility.execute()
File "/iscape/sites/demo/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 328, in execute
django.setup()
File "/iscape/sites/demo/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/iscape/sites/demo/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/iscape/sites/demo/local/lib/python2.7/site-packages/django/apps/config.py", line 112, in create
mod = import_module(mod_path)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named cms
我还可以确认VIRTUAL_ENV
在“激活”脚本中具有正确的值。这就像pip
知道安装了什么,但Django不知道。
这是Django1.8,顺便说一下,虽然我不知道有多少因素。
有什么想法吗?我没有从堆栈跟踪中得到任何东西,也不知道在哪里看。