我的软件包有问题,我已经使用pip install channels命令安装了django通道(仅通道),当我尝试运行服务器命令时,我只是遇到一个错误,说找不到模块,但是当我运行命令时< / p>
pip list | grep channels
安装了两个模块
channels 2.1.6
channels-redis 2.3.3
我不知道错误背后的原因 可以帮助我弄清楚我做错了什么
我已将它们添加到settings.py的已安装应用部分中
完整追溯
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x0458E780>
Traceback (most recent call last):
File "C:\Users\madhumani\workspace\ven\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "C:\Users\madhumani\workspace\ven\lib\site-packages\django\core\management\commands\runserver.py", line 112, in i
nner_run
autoreload.raise_last_exception()
File "C:\Users\madhumani\workspace\ven\lib\site-packages\django\utils\autoreload.py", line 248, in raise_last_exceptio
n
raise _exception[1]
File "C:\Users\madhumani\workspace\ven\lib\site-packages\django\core\management\__init__.py", line 327, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\madhumani\workspace\ven\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "C:\Users\madhumani\workspace\ven\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\madhumani\workspace\ven\lib\site-packages\django\apps\registry.py", line 89, in populate
app_config = AppConfig.create(entry)
File "C:\Users\madhumani\workspace\ven\lib\site-packages\django\apps\config.py", line 90, in create
module = import_module(entry)
File "C:\Users\madhumani\workspace\ven\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'channels'
答案 0 :(得分:0)
我也发生了同样的事情。我只是执行pip install channels
就可以了。