UWSGI says "ImportError: No module named wsgi"
When uWSGI starts up, it writes
"ImportError: No module named wsgi"
My uwsgi.xml
<!-- UWSGI XML Configuration File -->
<uwsgi>
<uid>quux</uid>
<gid>quux</gid>
<chdir>/var/www</chdir>
<!-- <socket>/var/www/uwsgi.sock</socket> -->
<socket>127.0.0.1:8012</socket>
<!-- <home>/home/klen/Projects/klen.github.com/_code/uwsgi/.virtualenv</home> -->
<plugins>python</plugins>
<pythonpath>/var/www/</pythonpath>
<module>wsgi</module>
<env>/usr/bin/python</env>
<processes>2</processes>
<max-requests>5000</max-requests>
<buffer-size>32768</buffer-size>
<harakiri>30</harakiri>
<reload-mercy>8</reload-mercy>
<master />
<no-orphans />
</uwsgi>
The server responds in the browser:
"uWSGI Error
Python application not found"
and puts
"[pid: 7529|app: -1|req: -1/1] 178.132.203.33 () {46 vars in 797 bytes} [Mon Mar 26 00:56:53 2012] GET /index.py => generated 48 bytes in 0 msecs (HTTP/1.0 500) 2 headers in 63 bytes (0 switches on core 0)"
in this log file.
I think I need to install the wsgi module for uWSGI as it says "ImportError: No module wsgi". How to check if this module is installed?
source to share
You specified <module>wsgi</module>
, and so uWSGI does what you asked, load a named module wsgi
and serve it. How is your python script installed? You didn't even mention that you have a python program to serve.
Perhaps you really need to use a directive <file>
to tell uWSGI the path to read the python file and execute that. If you are using an installed module, replace wsgi
in the tag <module>
with the appropriate module you are trying to execute.
source to share