2

I am trying to run daphne installed inside the virtualenv and the following are the errors:

  Traceback (most recent call last):
  File "/path-to-virtualenv/bin/daphne", line 7, in <module>
    from daphne.cli import CommandLineInterface
  File "/path-to-virtualenv/local/lib/python3.6/dist-packages/daphne/cli.py", line 7, in <module>
    from .server import Server
  File "/path-to-virtualenv/local/lib/python3.6/dist-packages/daphne/server.py", line 4, in <module>
    from twisted.internet import asyncioreactor  # isort:skip
  ModuleNotFoundError: No module named 'twisted.internet'

Environment:
1. mac osx mojave
2. python 3.6.5

When I try to import the module twisted.internet after activating the virtualenv, it works without any problem.

When I try to run daphne without using the virtualenv (global install), it works without throwing any errors as shown.

Following are the packages installed (by pip install -U channels):

asgiref       2.3.2  
async-timeout 3.0.0  
attrs         18.2.0 
autobahn      18.9.2 
Automat       0.7.0  
channels      2.1.3  
constantly    15.1.0 
daphne        2.2.2  
Django        2.1.2  
hyperlink     18.0.0 
idna          2.7    
incremental   17.5.0 
pip           18.0   
PyHamcrest    1.9.0  
pytz          2018.5 
setuptools    40.4.3 
six           1.11.0 
txaio         18.8.1 
wheel         0.32.0
Adarsh
  • 3,273
  • 3
  • 20
  • 44
  • uninstalled virtualenv, upgraded it, installed all the dependencies and its working now.. Have no idea what could have caused this behaviour though – Adarsh Oct 04 '18 at 07:55

0 Answers0