Home > Blockchain >  django-admin dose not create project
django-admin dose not create project

Time:07-23

I'm running django 2.0.7 on a verual envirment python3 and when i run **django-admin startproject trydjango1 . ** the following error occers can you please help me to solve this problem


Traceback (most recent call last): File "C:\Users\TG\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in run_module_as_main return run_code(code, main_globals, None, File "C:\Users\TG\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code exec(code, run_globals) File "D:\django-projects\Test1\Scripts\django-admin.exe_main.py", line 7, in File "D:\django-projects\Test1\lib\site-packages\django\core\management_init.py", line 371, in execute_from_command_line utility.execute() File "D:\django-projects\Test1\lib\site-packages\django\core\management_init.py", line 365, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "D:\django-projects\Test1\lib\site-packages\django\core\management\base.py", line 288, in run_from_argv self.execute(*args, **cmd_options) File "D:\django-projects\Test1\lib\site-packages\django\core\management\base.py", line 335, in execute output = self.handle(*args, **options) File "D:\django-projects\Test1\lib\site-packages\django\core\management\commands\startproject.py", line 20, in handle
super().handle('project', project_name, target, **options) File "D:\django-projects\Test1\lib\site-packages\django\core\management\templates.py", line 117, in handle django.setup() File "D:\django-projects\Test1\lib\site-packages\django_init_.py", line 16, in setup from django.urls import set_script_prefix File "D:\django-projects\Test1\lib\site-packages\django\urls_init_.py", line 1, in from .base import ( File "D:\django-projects\Test1\lib\site-packages\django\urls\base.py", line 8, in from .exceptions import NoReverseMatch, Resolver404 File "D:\django-projects\Test1\lib\site-packages\django\urls\exceptions.py", line 1, in from django.http import Http404 File "D:\django-projects\Test1\lib\site-packages\django\http_init_.py", line 5, in from django.http.response import ( File "D:\django-projects\Test1\lib\site-packages\django\http\response.py", line 13, in from django.core.serializers.json import DjangoJSONEncoder File "D:\django-projects\Test1\lib\site-packages\django\core\serializers_init_.py", line 23, in from django.core.serializers.base import SerializerDoesNotExist File "D:\django-projects\Test1\lib\site-packages\django\core\serializers\base.py", line 6, in from django.db import models File "D:\django-projects\Test1\lib\site-packages\django\db\models_init_.py", line 3, in from django.db.models.aggregates import * # NOQA File "D:\django-projects\Test1\lib\site-packages\django\db\models\aggregates.py", line 5, in from django.db.models.expressions import Case, Func, Star, When File "D:\django-projects\Test1\lib\site-packages\django\db\models\expressions.py", line 486, in class TemporalSubtraction(CombinedExpression): File "D:\django-projects\Test1\lib\site-packages\django\db\models\expressions.py", line 487, in TemporalSubtraction
output_field = fields.DurationField() File "D:\django-projects\Test1\lib\site-packages\django\db\models\fields_init_.py", line 155, in init if isinstance(choices, collections.Iterator): AttributeError: module 'collections' has no attribute 'Iterator'


CodePudding user response:

You should try different python or/and django version, because both are not compatible with each other.

Try upgrading Django to 2.2.28 version, or run project under python 3.6 (or even lower ver).

CodePudding user response:

I think you should install a newer version of django. It could be that some packages in the version of django you are using are not supported by python 3. I suggest you upgrade to django 3

  • Related