Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

uwsgi installation error in windows 7

Trying to install uwsgi according to documentation. I'm getting the below error on Windows 7.

What should I do?

(uwsgi-tutorial) C:\Users\Home\Videos\uwsgi-tutorial\mysite>pip install uwsgi
Collecting uwsgi
Using cached uwsgi-2.0.11.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
  File "<string>", line 20, in <module>
  File "c:\users\home\appdata\local\temp\pip-build-04g1m6\uwsgi\setup.py", line 3, in <module>
    import uwsgiconfig as uc
  File "uwsgiconfig.py", line 8, in <module>
    uwsgi_os = os.uname()[0]
AttributeError: 'module' object has no attribute 'uname'

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\home\appdata\local\temp\pip-build-04g1m6\uwsgi
like image 463
StackExchange Avatar asked Aug 23 '15 06:08

StackExchange


People also ask

Does Uwsgi work on Windows?

uWSGI doesn't work on bare Windows. (It might work on Cygwin, but that's probably not something you want to pursue.)

How do I know if Uwsgi is installed?

sock socket files in the /run/uwsgi directory. Check for the existence of the socket files within the /run/uwsgi directory by typing: sudo ls /run/uwsgi.

Where does pip install Uwsgi?

The uwsgi binary is placed in /usr/bin/uwsgi when installing uwsgi this way.


3 Answers

uWSGI can be compiled on Windows only using cygwin. There is no such thing as uname in normal Windows console, but it exists inside cygwin. If you're already in cygwin console, try to run uname command, if that exists, check if os.uname() in python inside cygwin is also working.

like image 148
GwynBleidD Avatar answered Oct 19 '22 04:10

GwynBleidD


Latest news from the front, uWSGI perfectly works on Windows 10 in bash on Ubuntu on Windows

As Linux subsystem still in beta, i'd not recommend for production usage, however this will cover all dev needs.

P.S. i know that op ask about Windows 7, however as Windows 10 and Linux subsystem come to Windows world later, i think i can leave this here.

like image 20
Reishin Avatar answered Oct 19 '22 03:10

Reishin


uWSGI can be compiled on Windows using Cygwin. But unfortunately, I was getting the same message with the Cygwin.

Here I am sharing the other way to install uWSGI on windows.

Step 1: Download the stable release and extract the tar file

Step 2: Open uwsgiconfig.py and import platform then replace os.uname()[index] with platform.uname()[index]

Change

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]

To

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]

Step 3: Run python setup.py install

Note: You may need to install GCC and configure it.

like image 2
Romil Patel Avatar answered Oct 19 '22 04:10

Romil Patel