Django命令”djangadmin.py启动项目mysite“

2024-05-29 02:24:37 发布

您现在位置:Python中文网/ 问答频道 /正文

 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

Tags: djangoinfrompycoreimportlibpackages
2条回答

您需要将Python降级到2.7,或者将Python升级到3.2或更新版本(当前稳定的3.x是3.3)并使用django1.5。如果你想要稳定,我推荐降级选项。在

Django 1.5 is the first Django release with support for Python 3 (specifically, Python 3.2 and newer). Python 3 support is still considered experimental largely because it hasn't received as much real-world testing as we'd like but a Python 3 porting guide is available if you'd like to give it a try, and we will be considering Python 3 compatibility bugs to be blockers for future releases.

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

现在您需要使用python2.7。在

相关问题 更多 >

    热门问题