windows下python安装uwsgi

1.使用pip安装

pip install uwsgi

报错:os没有uname()

解决:

定位到uwsgiconfig.py文件中,首先import platform后,将os.unam()都改为platform.uname()即可。

os.uname()是不支持windows系统的。platform模块是支持任何系统。

2.下载uwsgi离线安装

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

解压后,进入目录下

python setup.py install

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

解决:配置C编译环境

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

我的电脑上安装有codeblocks,所以已经安装了MinGW,然后配置系统变量

path=;MinGW目录/bin

http://jingyan.baidu.com/article/6b97984da0bd8a1ca2b0bf90.html

3.再次安装

以为安装成功,结果仍然报错,后来查询资料发现目前windows尚不支持uwsgi。

参考:

http://lists.unbit.it/pipermail/uwsgi/2011-May/002092.html

http://blog.csdn.net/sunhuaqiang1/article/details/70185022

https://docs.python.org/3/library/os.html?highlight=uname#os.uname

https://stackoverflow.com/questions/32163910/uwsgi-installation-error-in-windows-7

原文地址:https://www.cnblogs.com/jasonhaven/p/7560009.html