轉windows安裝uwsgi
阿新 • • 發佈:2020-08-12
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
安裝成功