在 virtualenv 中安装 uwsgi 时出错

新手上路,请多包涵

我正在尝试在 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 许可协议

阅读 661
1 个回答

你需要安装 Python3.5 的开发文件,所以运行这个命令:

 apt-get install python3.5-dev

上面的命令将安装 Python 3 头文件以从源代码构建 uWSGI。

原文由 McGrady 发布,翻译遵循 CC BY-SA 3.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题