已解决fatal error: Python.h: No such file or directory

淡淡的烟草味﹌ 2023-09-26 19:45 161阅读 0赞

已解决fatal error: Python.h: No such file or directory

在这里插入图片描述

文章目录

    • 报错问题
    • 解决方法
    • 声明

报错问题

之前在工作中遇到过这个坑,记录一下问题以及解决方法,不一定针对所有情况都能用,但是可以供大家参考。
问题描述如下:

  1. [gcc -pthread] core/zlib.o
  2. [gcc -pthread] core/regexp.o
  3. [gcc -pthread] core/routing.o
  4. [gcc -pthread] core/yaml.o
  5. [gcc -pthread] core/ssl.o
  6. [gcc -pthread] core/legion.o
  7. [gcc -pthread] core/xmlconf.o
  8. [gcc -pthread] core/dot_h.o
  9. [gcc -pthread] core/config_py.o
  10. *** uWSGI compiling embedded plugins ***
  11. [gcc -pthread] plugins/python/python_plugin.o
  12. In file included from plugins/python/python_plugin.c:1:0:
  13. plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory
  14. #include <Python.h>
  15. ^
  16. compilation terminated.
  17. ----------------------------------------
  18. Command "/usr/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-dsr9i4nq/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-9835ofpr-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-dsr9i4nq/uwsgi/

在这里插入图片描述

解决方法

解决方法如下

在这里插入图片描述

  1. yum install python34-devel

安装完后,接着pip安装uwsgi

声明

解决方法参考网络,如有侵权联系我删除

发表评论

表情:
评论列表 (有 0 条评论,161人围观)

还没有评论,来说两句吧...

相关阅读