question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImportError: No module named 'asgiref.sync'

See original GitHub issue

When I build deepqa:latest image, from the root directory:

docker build -t deepqa:latest .

get error:

 ---> Running in 76634673f149
Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.5/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.5/site-packages/django/core/management/__init__.py", line 347, in execute
    django.setup()
  File "/usr/local/lib/python3.5/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python3.5/site-packages/django/apps/registry.py", line 120, in populate
    app_config.ready()
  File "/usr/local/lib/python3.5/site-packages/channels/apps.py", line 17, in ready
    monkeypatch_django()
  File "/usr/local/lib/python3.5/site-packages/channels/hacks.py", line 10, in monkeypatch_django
    from .management.commands.runserver import Command as RunserverCommand
  File "/usr/local/lib/python3.5/site-packages/channels/management/commands/runserver.py", line 12, in <module>
    from channels.routing import get_default_application
  File "/usr/local/lib/python3.5/site-packages/channels/routing.py", line 9, in <module>
    from channels.http import AsgiHandler
  File "/usr/local/lib/python3.5/site-packages/channels/http.py", line 17, in <module>
    from asgiref.sync import async_to_sync, sync_to_async
ImportError: No module named 'asgiref.sync'
The command '/bin/sh -c python3 manage.py makemigrations' returned a non-zero code: 1

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

8reactions
rahul6612commented, Mar 17, 2018

your channel version is latest so install the latest version of asgiref

pip install asgiref==2.2.0

3reactions
aswiniS2commented, Jun 6, 2018

I have installed latest version of channels and asgiref, but still I am getting that error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Django Channels No module named 'asgiref.sync' error
your channel version is latest so install the latest version of asgiref, try: pip install asgiref==3.1.2.
Read more >
No module named 'asgiref.sync'_蔡坚立的博客
I found out the problem was with old version of asgiref I just had to update django and it updated also the asgiref...
Read more >
no module named django / python import error (If Installed / If ...
Fix ModuleNotFoundError ( no module named django) Python Import Error (If Installed / If Exists)#python #error #fix #fixed #howto Hey guys in ...
Read more >
no module named 'six' - OSCHINA - 中文开源技术交流社区
Django——ModuleNotFoundError: No module named 'asgiref.sync'. https://my.oschina.net/u/4312661/blog/3729817. Django+channels运行时报错Unhandled exception in ...
Read more >
GeoNode/general - Gitter
... File "manage.py", line 28, in <module> from django.core.management import execute_from_command_line ImportError: No module named django.core.management.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found