当我尝试使用python3.6创建一个django项目时,会出现此错误:
Error creating Django application: Error on python side. Exit code: 1, err: Traceback (most recent call last):
File "D:\PyCharm 2017.3\helpers\pycharm\_jb_django_project_creator.py", line 12, in <module>
management.execute_from_command_line(argv=["django-admin", "startproject", project_name, path])
File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\core\management\__init__.py", line 354, in execute_from_command_line
utility.execute()
File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\core\management\__init__.py", line 328, in execute
django.setup()
File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\__init__.py", line 15, in setup
from django.utils.log import configure_logging
File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\utils\log.py", line 16, in <module>
from django.views.debug import ExceptionReporter, get_exception_reporter_filter
File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\views\debug.py", line 9, in <module>
from django.core.urlresolvers import Resolver404, resolve
File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\core\urlresolvers.py", line 17, in <module>
from django.http import Http404
File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\http\__init__.py", line 4, in <module>
from django.http.response import (
File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\http\response.py", line 13, in <module>
from django.core.serializers.json import DjangoJSONEncoder
File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\core\serializers\__init__.py", line 24, in <module>
from django.core.serializers.base import SerializerDoesNotExist
File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\core\serializers\base.py", line 6, in <module>
from django.db import models
File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\db\models\__init__.py", line 6, in <module>
from django.db.models.query import Q, QuerySet, Prefetch # NOQA
File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\db\models\query.py", line 16, in <module>
from django.db.models import sql
File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\db\models\sql\__init__.py", line 2, in <module>
from django.db.models.sql.subqueries import * # NOQA
File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\db\models\sql\subqueries.py", line 7, in <module>
from django.db.models.query_utils import Q
File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\db\models\query_utils.py", line 13, in <module>
from django.db.backends import utils
File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\db\backends\utils.py", line 11, in <module>
from django.utils.timezone import utc
File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\utils\timezone.py", line 17, in <module>
import pytz
File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\pytz\__init__.py", line 32, in <module>
from pytz.lazy import LazyDict, LazyList, LazySet
File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\pytz\lazy.py", line 3, in <module>
from UserDict import DictMixin
File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\UserDict.py", line 167
raise TypeError, "pop expected at most 2 arguments, got "\
^
SyntaxError: invalid syntax
我的电脑上有python2.7和3.6。当我用python2.7创建一个django项目时,没有任何问题。当我使用python3.6作为解释器时,这个错误只会引发。
有人可以告诉我如何解决它吗?
感谢您的关注和时间。