[Solved] Windows installation uwsgi error: AttributeError: module’os’ has no attribute’uname’

Win10 system does not support the installation of UWSGI, no need to try

installation

pip install uwsgi

windows installation error

AttributeError: module’os’ has no attribute’uname’

Error description:

It is because in the uwsgiconfig.py file, os.uname() does not support windows systems, and the platform module supports any system.

solution:

uwsgi offline installation:

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

Put it into the virtual environment of the project, as shown in the figure below:

Modify the os.uname() in the uwsgiconfig.py file to platform.uname().

before fixing:

import os
 import re
 import time
​
uwsgi_os = os.uname()[0]
uwsgi_os_k = re.split( ' [-+_] ' , os.uname()[2 ])[0]
uwsgi_os_v = os.uname()[3 ]
uwsgi_cpu = os.uname()[4]

After modification

import os
 import re
 import time
 import platform
​
uwsgi_os = platform.uname()[0]
uwsgi_os_k = re.split( ' [-+_] ' , platform.uname()[2 ])[0]
uwsgi_os_v = platform.uname()[3 ]
uwsgi_cpu = platform.uname()[4]

Enter the catalog

cd E:\WorkSpace\Python_worksapce\AXF\venv\Lib\site-packages\uWSGI-2.0.19.1

carried out:

python setup.py install

Error description: C language compilation environment needs to be installed

If there is no C compilation environment on this machine, you need to download a compiler

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *