OSError: (WinError 6) The handle is invalid, when running python manage.py shell, I do not understand what is happening?

models.py file

# Create your models here.
class Flight(models.Model):
    origin = models.CharField(max_length=64)
    destination = models.CharField(max_length=64)
    duration = models.IntegerField(null=False)

Then I run python manage.py shell in terminal

python manage.py shell
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.12.3 -- An enhanced Interactive Python. Type '?' for help.  

In [1]: from flights.models import Flight
Cancelling an overlapped future failed
future: <_OverlappedFuture pending overlapped=<pending, 0x1af989b8430> cb=[BaseProactorEventLoop._loop_self_reading()]>
Traceback (most recent call last):
  File "C:\Users\jaina\AppData\Local\Programs\Python\Python38\lib\asyncio\windows_events.py", line 66, in _cancel_overlapped
    self._ov.cancel()
OSError: [WinError 6] The handle is invalid

Above error happens, How can I resolve this, please help.

Are you using Django 5.0? If so, Django 5.0 doesn’t support Python 3.8.

Are you using the system Python installation? If so, I suggest strongly that you set up a virtual environment as described at How to install Django on Windows | Django documentation | Django

Thank you for your response. Since I am new to Django, I wasn’t aware, but when I ran it with Python 3.12, the error was resolved. I really appreciate your help!!!