site-packages
您可能有 Django,但您使用的 Python 版本在其文件夹中没有 Django 。检查您正在使用哪个版本以及您在哪个版本上安装了 Django。从昨天开始,您可能已经更改了默认的 Python 解释器:
$ python
Python 2.7.3 (default, Dec 18 2012, 13:50:09)
Type "help", "copyright", "credits" or "license" for more information.
>>> from django.core.management import execute_from_command_line
>>>
[...]
$ python3
Python 3.2.3 (default, Jul 23 2012, 16:48:24)
Type "help", "copyright", "credits" or "license" for more information.
>>> from django.core.management import execute_from_command_line
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named django.core.management
在这里,我的 Python 2.7site-packages
文件夹中有 Django,但在 Python 3 上没有,它在我的 then.xml 中找不到任何django
模块PYTHONPATH
。