Saw this on stack overflow: https://stackoverflow.com/questions/70347099/error-installing-a-django-project-attrributeerror-module-collections-has-no-a
Supports what Mordecai Etukudo said about version incompatability. *Type "help", "copyright", "credits" or "license" for more information. * *>>> import collections * *>>> collections.Iterator * *<stdin>:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working * *<class 'collections.abc.Iterator'>* How mature is your project? Changing python (or django) versions isnt always trivial but I suspect your project is fairly new though and you may want to consider using the latest of each. On Saturday, February 17, 2024 at 3:32:32 PM UTC-5 Ryan Nowakowski wrote: > Your Python version is likely too new for your version of Django. > > > On February 17, 2024 6:06:41 AM CST, Brigid Sang <[email protected]> > wrote: > >> I'm encoutering the below error, how can I fix this >> >> Traceback (most recent call last): >> File "/home/brigid/.local/bin/django-admin", line 8, in <module> >> sys.exit(execute_from_command_line()) >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> File >> "/home/brigid/.local/lib/python3.11/site-packages/django/core/management/__init__.py", >> >> line 371, in execute_from_command_line >> utility.execute() >> File >> "/home/brigid/.local/lib/python3.11/site-packages/django/core/management/__init__.py", >> >> line 365, in execute >> self.fetch_command(subcommand).run_from_argv(self.argv) >> File >> "/home/brigid/.local/lib/python3.11/site-packages/django/core/management/base.py", >> >> line 288, in run_from_argv >> self.execute(*args, **cmd_options) >> File >> "/home/brigid/.local/lib/python3.11/site-packages/django/core/management/base.py", >> >> line 335, in execute >> output = self.handle(*args, **options) >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> File >> "/home/brigid/.local/lib/python3.11/site-packages/django/core/management/commands/startproject.py", >> >> line 20, in handle >> super().handle('project', project_name, target, **options) >> File >> "/home/brigid/.local/lib/python3.11/site-packages/django/core/management/templates.py", >> >> line 117, in handle >> django.setup() >> File >> "/home/brigid/.local/lib/python3.11/site-packages/django/__init__.py", line >> 16, in setup >> from django.urls import set_script_prefix >> File >> "/home/brigid/.local/lib/python3.11/site-packages/django/urls/__init__.py", >> line 1, in <module> >> from .base import ( >> File >> "/home/brigid/.local/lib/python3.11/site-packages/django/urls/base.py", >> line 8, in <module> >> from .exceptions import NoReverseMatch, Resolver404 >> File >> "/home/brigid/.local/lib/python3.11/site-packages/django/urls/exceptions.py", >> >> line 1, in <module> >> from django.http import Http404 >> File >> "/home/brigid/.local/lib/python3.11/site-packages/django/http/__init__.py", >> line 5, in <module> >> from django.http.response import ( >> File >> "/home/brigid/.local/lib/python3.11/site-packages/django/http/response.py", >> line 13, in <module> >> from django.core.serializers.json import DjangoJSONEncoder >> File >> "/home/brigid/.local/lib/python3.11/site-packages/django/core/serializers/__init__.py", >> >> line 23, in <module> >> from django.core.serializers.base import SerializerDoesNotExist >> File >> "/home/brigid/.local/lib/python3.11/site-packages/django/core/serializers/base.py", >> >> line 6, in <module> >> from django.db import models >> File >> "/home/brigid/.local/lib/python3.11/site-packages/django/db/models/__init__.py", >> >> line 3, in <module> >> from django.db.models.aggregates import * # NOQA >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> File >> "/home/brigid/.local/lib/python3.11/site-packages/django/db/models/aggregates.py", >> >> line 5, in <module> >> from django.db.models.expressions import Case, Func, Star, When >> File >> "/home/brigid/.local/lib/python3.11/site-packages/django/db/models/expressions.py", >> >> line 486, in <module> >> class TemporalSubtraction(CombinedExpression): >> File >> "/home/brigid/.local/lib/python3.11/site-packages/django/db/models/expressions.py", >> >> line 487, in TemporalSubtraction >> output_field = fields.DurationField() >> ^^^^^^^^^^^^^^^^^^^^^^ >> File >> "/home/brigid/.local/lib/python3.11/site-packages/django/db/models/fields/__init__.py", >> >> line 155, in __init__ >> if isinstance(choices, collections.Iterator): >> ^^^^^^^^^^^^^^^^^^^^ >> AttributeError: module 'collections' has no attribute 'Iterator' >> >> -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1993ba40-c8c3-4aa9-a819-56384137be73n%40googlegroups.com.

