django - django频道安装错误
问题描述
我正在尝试使用 Django 创建一个一对一的实时消息传递系统。经过搜索,我发现了关于django-channels
. 所以我用 python 3.5 和最新的 Django 创建了一个虚拟环境,但是当我这样做时,pip install channels
我得到:
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -I/home/kshitij/Documents/projects/personal/maker/venv/include/python3.5m -c src/twisted/test/raiser.c -o build/temp.linux-x86_64-3.5/src/twisted/test/raiser.o
#include "Python.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
可能是因为缺少 python 标头所以我这样做了:sudo apt-get install python3-dev
但它仍然显示相同的错误。我应该怎么办?
pip version: 18
python version: 3.5
django version: 2.1
我尝试做sudo apt-get install python3-dev
但得到:
ImportError: cannot import name '_BACKCOMPAT_MAGIC_NUMBER'
解决方案
- 验证您的
pip
is notpip
及其pip3
. - 您也可以尝试安装
sudo apt install python3.X-dev
.
对你来说是sudo apt install python3.5-dev
推荐阅读
- flutter - 在bottomNavigationBar下方显示bottomSheet
- azure - 通过 Release/CD 导入 AppInsight Instrumentation Key 并在应用程序的 appsettings 中更新 Instrumentation 密钥
- java - 如何在java中设置没有身份验证的smtp服务器
- java - Android允许用户在地图上只选择公交车站
- android - 听众在我的片段中不起作用
- javascript - 如何创建二维数组?
- swift - 无法使用 UserDefaults (Swift) 让欢迎 ViewController 仅显示一次
- database - 数据库系统实现演示项目
- c - 客户端经过的时间不起作用 TCP SOCKET
- java - 使用 Java8 映射到列表