【Python】Windows系统安装uWSGI报错AttributeError: module 'os' has no attribute 'uname'解决办法

使用pip安装

pip install uwsgi
报错:AttributeError: module 'os' has no attribute 'uname'

报错说明:

是因为uwsgiconfig.py文件中,os.uname()是不支持windows系统的,platform模块是支持任何系统。

下载uwsgi离线安装

https://pypi.python.org/pypi/uWSGI/ 

【Python】Windows系统安装uWSGI报错AttributeError: module 'os' has no attribute 'uname'解决办法

解压后,进入目录下,修改uwsgiconfig.py文件中的os.uname()为platform.uname()

然后再cd进入目录执行:python setup.py install

报错:Exception: you need a C compiler to builduWSGI

报错说明:需要安装C语言编译环境

如果本机上没有C编译环境,需要下载一个编译器

推荐下载:MinGW

安装好之后配置环境变量:path=MinGW安装目录/bin

3.再次安装

python setup.py install