centos下python3.6安装uwsgi失败的解决方法

报错信息(省略大部分):

plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory
     #include <Python.h>

原因:必须同时安装“编译工具”和“python-devel”,才能成功安装uwsgi

解决方法:

1.安装编译工具

yum install -y gcc* pcre-devel openssl-devel

2.安装python-devel(重要)

这一步跟着网上很多步骤走,但是都出错了。可能是版本不同的原因,下面是我总结的方法:

首先yum搜索python-devel

yum search python-devel

搜索到了

python-devel.x86_64 : The libraries and header files needed for Python development

安装下来后发现是python2.7版本的。然而需要安装的是3.6版本的。

用如下命令搜索3.6版本:

yum search python36-devel

搜索到了:

python36-devel.x86_64 : Libraries and header files needed for Python development

是需要的版本,然后安装:

yum install python36-devel.x86_64

3.最后安装uwsgi:

pip install uwsgi

成功!

 

转载于:https://www.cnblogs.com/rendan/p/10791957.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值