2

python 3.8 windows OS 10 Django 3.0

I have upgraded to python 3.8 from 3.6.8 but when I started my django project I get following error. By quickly looking at the trace it appears that there is some issue with the asyncioreactor file in twisted package. Any solution to this or is it known bug.

> C:\Users\user\Desktop\WorkingPy38\Current> python manage.py
> runserver 127.0.0.1:8080 Exception in thread django-main-thread:
> Traceback (most recent call last):   File
> "C:\Users\user\AppData\Local\Programs\Python\Python38\Lib\threading.py",
> line 932, in _bootstrap_inner
>     self.run()   File "C:\Users\user\AppData\Local\Programs\Python\Python38\Lib\threading.py",
> line 870, in run
>     self._target(*self._args, **self._kwargs)   File "C:\Users\user\.virtualenvs\Current-lgPmbAD0\lib\site-packages\django\utils\autoreload.py",
> line 53, in wrapper  
>     fn(*args, **kwargs)   File "C:\Users\user\.virtualenvs\Current-lgPmbAD0\lib\site-packages\django\core\management\commands\runserver.py",
> line 109, in inner_run
>     autoreload.raise_last_exception()   File "C:\Users\user\.virtualenvs\Current-lgPmbAD0\lib\site-packages\django\utils\autoreload.py",
> line 76, in raise_last_exception
>     raise _exception[1]   File "C:\Users\user\.virtualenvs\Current-lgPmbAD0\lib\site-packages\django\core\management\__init__.py",
> line 357, in  execute
>     autoreload.check_errors(django.setup)()   File "C:\Users\user\.virtualenvs\Current-lgPmbAD0\lib\site-packages\django\utils\autoreload.py",
> line 53, in wrapper  
>     fn(*args, **kwargs)   File "C:\Users\user\.virtualenvs\Current-lgPmbAD0\lib\site-packages\django\__init__.py",
> line 24, in setup
>     apps.populate(settings.INSTALLED_APPS)   File "C:\Users\user\.virtualenvs\Current-lgPmbAD0\lib\site-packages\django\apps\registry.py",
> line 91, in populate    
>     app_config = AppConfig.create(entry)   File "C:\Users\user\.virtualenvs\Current-lgPmbAD0\lib\site-packages\django\apps\config.py",
> line 116, in create       
>     mod = import_module(mod_path)   File "C:\Users\user\.virtualenvs\Current-lgPmbAD0\lib\importlib\__init__.py",
> line 127, in import_module
>     return _bootstrap._gcd_import(name[level:], package, level)   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import   File
> "<frozen importlib._bootstrap>", line 991, in _find_and_load   File
> "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked 
> File "<frozen importlib._bootstrap>", line 671, in _load_unlocked  
> File "<frozen importlib._bootstrap_external>", line 783, in
> exec_module   File "<frozen importlib._bootstrap>", line 219, in
> _call_with_frames_removed   File "C:\Users\user\.virtualenvs\Current-lgPmbAD0\lib\site-packages\channels\apps.py",
> line 6, in <module>
>     import daphne.server   File "C:\Users\user\.virtualenvs\Current-lgPmbAD0\lib\site-packages\daphne\server.py",
> line 18, in <module>
>     asyncioreactor.install()   File "C:\Users\user\.virtualenvs\Current-lgPmbAD0\lib\site-packages\twisted\internet\asyncioreactor.py",
> line 320, in  install
>     reactor = AsyncioSelectorReactor(eventloop)   File "C:\Users\user\.virtualenvs\Current-lgPmbAD0\lib\site-packages\twisted\internet\asyncioreactor.py",
> line 69, in __init__
>     super().__init__()   File "C:\Users\user\.virtualenvs\Current-lgPmbAD0\lib\site-packages\twisted\internet\base.py",
> line 571, in __init__  
>     self.installWaker()   File "C:\Users\user\.virtualenvs\Current-lgPmbAD0\lib\site-packages\twisted\internet\posixbase.py",
> line 286, in installWaker
>     self.addReader(self.waker)   File "C:\Users\user\.virtualenvs\Current-lgPmbAD0\lib\site-packages\twisted\internet\asyncioreactor.py",
> line 151, in  addReader
>     self._asyncioEventloop.add_reader(fd, callWithLogger, reader,   File
> "C:\Users\user\AppData\Local\Programs\Python\Python38\Lib\asyncio\events.py",
> line 501, in add_reader
>     raise NotImplementedError
PhantomS
  • 420
  • 4
  • 14

1 Answers1

2

I've solved that with this

AsyncioReactor_Modify

And https://github.com/django/channels/issues/969 andrewgodwin(The Channels..) Said

You're apparently trying to create a UNIX socket under Windows, which is never going to work

minsu kim
  • 41
  • 3
  • https://github.com/django/channels/issues/969#issuecomment-596746621 another solution. just add this to current working consumer.py. – minsu kim Mar 29 '20 at 10:19