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.

runserver raise error.ReactorAlreadyInstalledError("reactor already installed")

See original GitHub issue

Now I add channels to project by installation guide from docs

  • OS and runtime environment virtualenv with Python 3.5.3 [GCC 6.3.0 20170118] on linux / debian Jessie

  • The versions of Channels, Daphne, Django, Twisted daphne==2.0.0 Django==2.0.2 Twisted==17.9.0

  • What you expected to happen vs. what actually happened python src/manage.py runserver 8925 and get raise error.ReactorAlreadyInstalledError(“reactor already installed”)

  • How you’re running Channels (runserver? daphne/runworker? Nginx/Apache in front?) on localhost just python src/manage.py runserver 8925

  • Console logs and full tracebacks of any errors

$ ls src
apps
project_src 
manage.py  

$ ls src/project_src/
asgi.py  
__init__.py  
locale
routing.py
settings  
static  
templates  
urls.py  
wsgi.py

ROOT_URLCONF = ‘project_src.urls’ WSGI_APPLICATION = ‘project_src.wsgi.application’ ASGI_APPLICATION = “project_src.routing.application”

(.venv3) berg@berg-dell:/Working-dir/$python src/manage.py runserver 8925
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7f4155431e18>
Traceback (most recent call last):
  File "/Working-dir/.venv3/lib/python3.5/site-packages/django/utils/autoreload.py", line 225, in wrapper
    fn(*args, **kwargs)
  File "/Working-dir/.venv3/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 113, in inner_run
    autoreload.raise_last_exception()
  File "/Working-dir/.venv3/lib/python3.5/site-packages/django/utils/autoreload.py", line 248, in raise_last_exception
    raise _exception[1]
  File "/Working-dir/.venv3/lib/python3.5/site-packages/django/core/management/__init__.py", line 327, in execute
    autoreload.check_errors(django.setup)()
  File "/Working-dir/.venv3/lib/python3.5/site-packages/django/utils/autoreload.py", line 225, in wrapper
    fn(*args, **kwargs)
  File "/Working-dir/.venv3/lib/python3.5/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Working-dir/.venv3/lib/python3.5/site-packages/django/apps/registry.py", line 89, in populate
    app_config = AppConfig.create(entry)
  File "/Working-dir/.venv3/lib/python3.5/site-packages/django/apps/config.py", line 116, in create
    mod = import_module(mod_path)
  File "/Working-dir/.venv3/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 673, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/Working-dir/.venv3/lib/python3.5/site-packages/channels/apps.py", line 6, in <module>
    import daphne.server  # noqa
  File "/Working-dir/.venv3/lib/python3.5/site-packages/daphne/server.py", line 3, in <module>
    asyncioreactor.install()  # isort:skip
  File "/Working-dir/.venv3/lib/python3.5/site-packages/twisted/internet/asyncioreactor.py", line 322, in install
    installReactor(reactor)
  File "/Working-dir/.venv3/lib/python3.5/site-packages/twisted/internet/main.py", line 32, in installReactor
    raise error.ReactorAlreadyInstalledError("reactor already installed")
twisted.internet.error.ReactorAlreadyInstalledError: reactor already installed

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:23 (15 by maintainers)

github_iconTop GitHub Comments

3reactions
proofit404commented, Feb 3, 2018
import channels.apps

?

3reactions
andrewgodwincommented, Feb 3, 2018

Oof, if it’s in sentry/raven a lot of people are going to run into this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

twisted.internet.error.ReactorAlreadyInstalledError: reactor ...
For me this worked, I put it before the CrawlerProcess import sys if "twisted.internet.reactor" in sys.modules: del ...
Read more >
Python twisted.internet.error.ReactorAlreadyInstalledError ...
def test_alreadyInstalled(self): """ If a reactor is already installed, L{installReactor} raises L{ReactorAlreadyInstalledError}.
Read more >
reactor already installed - Google Groups
I had error "reactor already installed" after packing mine app with pyinstaller. Is any way for using twisted with kivy and pyinstaller?
Read more >
1D convolutional neural network weight matrix...anycodings
Don't understand this asyncio error : learnpython ... twisted.internet.error.reactoralreadyinstallederror: reactor already installed.
Read more >
twisted.internet.error.ReactorAlreadyInstalledError Example
Learn how to use python api twisted.internet.error.ReactorAlreadyInstalledError. ... raise error.ReactorAlreadyInstalledError("reactor already installed") ...
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