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

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

在这里插入图片描述

报错问题

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

[gcc -pthread] core/zlib.o
    [gcc -pthread] core/regexp.o
    [gcc -pthread] core/routing.o
    [gcc -pthread] core/yaml.o
    [gcc -pthread] core/ssl.o
    [gcc -pthread] core/legion.o
    [gcc -pthread] core/xmlconf.o
    [gcc -pthread] core/dot_h.o
    [gcc -pthread] core/config_py.o
    *** uWSGI compiling embedded plugins ***
    [gcc -pthread] plugins/python/python_plugin.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
     #include <Python.h>
                        ^
    compilation terminated.
 
    ----------------------------------------
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/

在这里插入图片描述

解决方法

解决方法如下

在这里插入图片描述

yum install python34-devel

安装完后,接着pip安装uwsgi

福利

每周会送6本技术书籍包邮到家
由于博主时间精力有限,每天私信人数太多,没办法每个粉丝都及时回复
大家可以进社区裙或者添加博主微信
点击下方链接即可
http://t.csdn.cn/6kInJ

猜你喜欢

转载自blog.csdn.net/weixin_50843918/article/details/129936465