centos7下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

成功!

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM