转windows安装uwsgi


1. 直接在cmd中使用pip install uwsgi报错

直接在cmd中使用pip install uwsgi报错
AttributeError: module ‘os’ has no attribute ‘uname’
报错说明:
是因为uwsgiconfig.py文件中,os.uname()是不支持windows系统的,platform模块是支持任何系统

ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\ADMINI~1\AppData\Local\Temp\pip-install-9kgm_b8s\uwsgi\setup.py", line 3, in <module>
    import uwsgiconfig as uc
  File "C:\Users\ADMINI~1\AppData\Local\Temp\pip-install-9kgm_b8s\uwsgi\uwsgiconfig.py", line 8, in <module>
    uwsgi_os = os.uname()[0]
AttributeError: module 'os' has no attribute 'uname'
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in C:\Users\ADMINI~1\AppData\Local\Temp\pip-install-9kgm_b8s\uwsgi\
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

在这里插入图片描述

2. 下载uwsgi离线包进行安雯

uwsgi离线包:https://pypi.org/project/uWSGI/#files
下载后解压,找到文件uwsgiconfig.py

3. 修改uwsgiconfig.py文件

使用什么工具修改自己喜欢 ,但注意是全部修改

在这里插入图片描述

4. 进入文件目录后再运行python sueup.py install

发现还是报错了,原因是没有C语言编译
Exception: you need a C compiler to build uWSGI在这里插入图片描述

5. 下载安装MinGW

查看https://jingyan.baidu.com/article/0320e2c11564ca1b87507b8f.html

6 进入文件目录后再运行python sueup.py install

安装成功


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM