centos7 安装uwsgi失败

失败过程

我是Centos 直接安装没有其他操作

按照网上部署部署uwsgi+nginx+django 教程

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

安装Python包管理
easy_install 包 https://pypi.python.org/pypi/distribute

安装步骤:

1
2
3
4
5
> cd ~ wget
> https://pypi.python.org/packages/source/d/distribute/distribute-0.6.49.tar.gz
> tar xf distribute-0.6.49.tar.gz cd distribute-0.6.49 python2.7
> setup.py install easy_install --version pip 包:
> https://pypi.python.org/pypi/pip

发现没有自带没有安装 pip yum了pip
之后
使用pip安装
pip install uwsgi
报错一直没有解决
错误代码
ERROR: Command “/usr/bin/python2 -u -c ‘import setuptools, tokenize;file=’”’”’/tmp/pip-install-WeDbCr/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-record-ySrxMo/install-record.txt --single-version-externally-managed --compile” failed with error code 1 in /tmp/pip-install-WeDbCr/uwsgi/

解决方案

  1. 使用python3 安装uwsgi
  2. 在centos自带的Python2下 必须同时安装“编译工具”和“python-devel”

第二种方法代码
三步
1安装编译工具

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

正确截图在这里插入图片描述

2安装python依赖

1
yum install -y python-devel

正确截图
在这里插入图片描述

2安装uwsgi

1
pip install uwsgi

正确截图在这里插入图片描述