【问题标题】:probelm at installing channels(django), and importing it's inner packages(channels.layout)安装频道(django)和导入其内部包(channels.layout)时出现问题
【发布时间】:2021-04-06 21:25:40
【问题描述】:

我也有同样的问题。 pyhton(3.9.1)。 使用虚拟环境(venv)。 安装了django。 更新: setuptools: pip install --upgrade setuptools, pip(20.3.3): py -m pip install --upgrade pip 轮子:python -m pip install --upgrade pip setuptools wheel (今天的最新版本(30/12/20))。

尝试使用:python -m pip install -U 频道。 安装了“Microsoft Visual C++ Build Tools”

尝试了自安装twis​​ted:https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted

全部完成,但仍然无法正常工作。

还尝试了 pip 安装: 点安装 pytype pip install django-channels。

django-channels,但在 PyCharm 上运行时,它识别通道但不识别:channels.layers。

谁能帮忙?

【问题讨论】:

  • 很可能是因为您安装channels 的python 安装和Pycharm 使用的不同。在 Pycharm 中,在某处写 import sys; print(sys.executable),运行脚本。在终端中,写入python -c "import sys; print(sys.executable)" 并比较输出。
  • 第一个问题,我无法完成频道的安装。它失败了:'Building wheel for twisted (setup.py): started' 第二个问题是即使我尝试安装 django-channels,但是这个包不包括:channels.layers, from channels.layers import get_channel_layer

标签: python django pip django-channels channels


【解决方案1】:

我设法安装了它: 刚刚删除了 python,而是安装了 Anaconda 3。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-06
    • 1970-01-01
    • 1970-01-01
    • 2020-06-14
    • 2021-01-31
    相关资源
    最近更新 更多