New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.4.1 RuntimeError #292
Comments
I cannot replicate this on my side - it works exactly as expected. Can you provide a full |
env info as follow:
I just create a venv use command What's more, I try version 3.4.1 on windows and it works. Looks only linux has this problem. |
I can reproduce this. It's because you have the ~ $ python --version
Python 3.9.6
~ $ mktmpenv
...
This is a temporary environment. It will be deleted when you run 'deactivate'.
(tmp-98dde6625b183cc) ~/ve/tmp-98dde6625b183cc $ pip install Django
Collecting Django
Using cached Django-3.2.6-py3-none-any.whl (7.9 MB)
Collecting sqlparse>=0.2.2
Using cached sqlparse-0.4.1-py3-none-any.whl (42 kB)
Collecting asgiref<4,>=3.3.2
Using cached asgiref-3.4.1-py3-none-any.whl (25 kB)
Collecting pytz
Using cached pytz-2021.1-py2.py3-none-any.whl (510 kB)
Installing collected packages: sqlparse, pytz, asgiref, Django
Successfully installed Django-3.2.6 asgiref-3.4.1 pytz-2021.1 sqlparse-0.4.1
WARNING: You are using pip version 21.1.3; however, version 21.2.4 is available.
You should consider upgrading via the '/Users/carlton/ve/tmp-98dde6625b183cc/bin/python -m pip install --upgrade pip' command.
(tmp-98dde6625b183cc) ~/ve/tmp-98dde6625b183cc $ django-admin startproject Sample
(tmp-98dde6625b183cc) ~/ve/tmp-98dde6625b183cc $ ls
README.tmpenv Sample bin lib pyvenv.cfg
(tmp-98dde6625b183cc) ~/ve/tmp-98dde6625b183cc $ rm -rf Sample
(tmp-98dde6625b183cc) ~/ve/tmp-98dde6625b183cc $ tail -n +326 ~/Documents/Django-Stack/asgiref/asgiref/sync.py | head -n 7
# If they've set ASGI_THREADS, update the default asyncio executor for now
if "ASGI_THREADS" in os.environ:
loop = get_running_loop()
loop.set_default_executor(
ThreadPoolExecutor(max_workers=int(os.environ["ASGI_THREADS"]))
)
(tmp-98dde6625b183cc) ~/ve/tmp-98dde6625b183cc $ ASGI_THREADS=4 django-admin startproject Sample
Traceback (most recent call last):
...FRAMES OMITTED...
File "/Users/carlton/ve/tmp-98dde6625b183cc/lib/python3.9/site-packages/django/utils/deprecation.py", line 5, in <module>
from asgiref.sync import sync_to_async
File "/Users/carlton/ve/tmp-98dde6625b183cc/lib/python3.9/site-packages/asgiref/sync.py", line 304, in <module>
class SyncToAsync:
File "/Users/carlton/ve/tmp-98dde6625b183cc/lib/python3.9/site-packages/asgiref/sync.py", line 328, in SyncToAsync
loop = get_running_loop()
RuntimeError: no running event loop Lines 329 to 334 in f53fbef
|
Yes, it is, thanks! |
Hey @belongwqz — Glad that's got you moving! I'm going to reopen to let @andrewgodwin decide whether an adjustment is needed here. Presumably setting |
Thanks Carlton - that was indeed the problem. I've just pushed up a fix, will try and get it into a release soon. |
Thanks @andrewgodwin 🥇 |
I am not sure if this is solely because of the
|
ahh nevermind, seems this is duplicate of #278 |
Any idea when this fix will be released? |
I just have to get around to it - not sure when. Pandemic has put everything out of kilter. |
1.pip install django
Successfully installed asgiref-3.4.1 django-3.2.6 pytz-2021.1 sqlparse-0.4.1
2.django-admin startproject Sample
But use version 3.3.4 will be OK.
The text was updated successfully, but these errors were encountered: