我正在尝试在 linux ubuntu、python 3.5.2 上的虚拟环境中安装 uswgi
pip install uwsgi
我收到了这个错误
Failed building wheel for uwsgi
并在安装日志的末尾
*** uWSGI compiling embedded plugins ***
[thread 0][x86_64-linux-gnu-gcc -pthread] plugins/python/python_plugin.o
[thread 1][x86_64-linux-gnu-gcc -pthread] plugins/python/pyutils.o
In file included from plugins/python/python_plugin.c:1:0:
plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory
compilation terminated.
In file included from plugins/python/pyutils.c:1:0:
plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory
compilation terminated.
----------------------------------------
Command "/home/ubuntu/envflask/env/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wthov1ur/uwsgi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-quiupta5-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ubuntu/envflask/env/include/site/python3.5/uwsgi" failed with error code 1 in /tmp/pip-build-wthov1ur/uwsgi/
- Linux 4.4.0-66-通用 x86_64
- Python 3.5.2
有什么解决方案吗?谢谢
原文由 Alvaro B 发布,翻译遵循 CC BY-SA 4.0 许可协议
你需要安装 Python3.5 的开发文件,所以运行这个命令:
上面的命令将安装 Python 3 头文件以从源代码构建 uWSGI。