0
 D:\python\Project>c:\Python30\Scripts\django-admin.py startproject mysite
Traceback (most recent call last):
File "C:\Python30\Scripts\django-admin.py", line 2, in <module>
from django.core import management
File "c:\python30\Lib\site-packages\django\core\management\__init__.py", line
9, in <module>
from django.core.management.base import BaseCommand, CommandError, handle_de
fault_options
File "c:\python30\Lib\site-packages\django\core\management\base.py", line 15,
in <module>
from django.utils.encoding import force_str
File "c:\python30\Lib\site-packages\django\utils\encoding.py", line 13, in <mo
dule>
from django.utils.functional import Promise
File "c:\python30\Lib\site-packages\django\utils\functional.py", line 350, in
<module>
from functools import total_ordering
ImportError: cannot import name total_ordering
4

2 回答 2

0

您使用 Python 3.x 版本。这个 Python 版本在最新的 django 版本 1.5 中具有实验性支持,但无论如何,这并不是那么有用。

您现在需要使用 Python 2.7。

于 2013-03-14T16:12:20.490 回答
0

您需要将 Python 降级到 2.7,或者将 Python 升级到 3.2 或更高版本(当前稳定的 3.x 为 3.3)并使用 Django 1.5。如果您想要稳定性,我会推荐降级选项。

Django 1.5是第一个支持 Python 3(特别是 Python 3.2 和更新版本)的 Django 版本。Python 3 支持仍然被认为是实验性的——主要是因为它没有得到我们想要的那么多的实际测试——但是如果你想尝试一下,可以使用 Python 3 移植指南,我们将考虑将 Python 3 兼容性错误作为未来版本的障碍。

于 2013-03-14T16:42:48.663 回答