uWSGI: No request plugin is loaded, you will not be able to manage requests
Question:
I’ve loaded uWSGI v 1.9.20, built from source. I’m getting this error, but how do I tell which plugin is needed?
!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!
no request plugin is loaded, you will not be able to manage requests.
you may need to install the package for your language of choice, or simply load
it with --plugin.
!!!!!!!!!!! END OF WARNING !!!!!!!!!!
Which plugin should be loaded?
Answers:
It might be easiest to install uwsgi through pip instead of the package manager from the OS you’re using, the package in pip is usually more up to date than the package managers from the OS you might be using:
sudo pip install uwsgi
This solved it for me anyway.
For using multiple Python versions on the same server, I would advice to take a look at virtualenv:
https://virtualenv.pypa.io/en/latest/
I had this problem and was stuck for hours.
Python2
My issue is different than the answer listed, make sure you have plugins = python
in your uwsgi .ini
file and you install the uwsgi python
plugin:
sudo apt-get install uwsgi-plugin-python
Python3
If you’re using Python3, use the same approach and do:
sudo apt-get install uwsgi-plugin-python3
then add plugins = python3
inside your uwsgi .ini
file.
After I did the above my application worked. Obviously this is for python
projects, but a similar approach is required for other projects.
On my side, this is because instead of having [uwsgi]
as the header of my configuration inside /etc/uwsgi/apps-available/
, I put something else (the name of the app).
I had similar issue but this solved it (btw, I use MacOs, and both python2&3 versions installed, but I wanted to use Python3):
- Open terminal and check for python3 location by typing:
which python3
- Copy the full path and assign it to; plugins option in .ini file
I hope it helps!
Just stumbled upon this error message and wasted a couple of hours, yet in my case the cause was different from everything mentioned in other answers already.
Suppose you just installed a local uWSGI version via pip
into your own virtualenv (e.g. as described here).
Suppose you are now trying to run your uWSGI server as root (because you want to serve the app as www-data
user, for example). This is how you would do it, right?
. venv/bin/activate
sudo uwsgi --ini your-app.ini
Wrong! Even though your local uwsgi
is in your path after you activated your environment, this path is not passed into the sudo
command, and you are launching the system uwsgi
rather than your local one, which may be the source of endless confusion, like it was in my case.
So, the solution in my case was to simply specify the full path:
sudo /full/path/to/venv/bin/uwsgi --ini your-app.ini
If you’ve followed all the python plugin installation steps and uwsgi --plugin-list
still fails to list 0: python
as one of the plugins, try restarting your computer. My uwsgi instance ran as a service (from Bash, use service status-all
to see running services) and probably the updated config settings were loaded on service restart.
if you are using python3:
install plugin:
sudo apt install uwsgi-plugin-python3
add uwsgi python3 plugin line in your site config (.ini file):
plugins = python3
and if you want to list your uwsgi’s python plugins list:
ls -l /usr/lib/uwsgi/plugins/ | grep python
KEEP IN MIND python3 plugin is different from python2.
If you do not define python’s plugin uwsgi says:
!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!
no request plugin is loaded, you will not be able to manage requests.
you may need to install the package for your language of choice, or simply load it with --plugin.
!!!!!!!!!!! END OF WARNING !!!!!!!!!!
if you use python2’s plugin and your venv is in python3 it says:
ImportError: No module named site
I’ve loaded uWSGI v 1.9.20, built from source. I’m getting this error, but how do I tell which plugin is needed?
!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!
no request plugin is loaded, you will not be able to manage requests.
you may need to install the package for your language of choice, or simply load
it with --plugin.
!!!!!!!!!!! END OF WARNING !!!!!!!!!!
Which plugin should be loaded?
It might be easiest to install uwsgi through pip instead of the package manager from the OS you’re using, the package in pip is usually more up to date than the package managers from the OS you might be using:
sudo pip install uwsgi
This solved it for me anyway.
For using multiple Python versions on the same server, I would advice to take a look at virtualenv:
https://virtualenv.pypa.io/en/latest/
I had this problem and was stuck for hours.
Python2
My issue is different than the answer listed, make sure you have plugins = python
in your uwsgi .ini
file and you install the uwsgi python
plugin:
sudo apt-get install uwsgi-plugin-python
Python3
If you’re using Python3, use the same approach and do:
sudo apt-get install uwsgi-plugin-python3
then add plugins = python3
inside your uwsgi .ini
file.
After I did the above my application worked. Obviously this is for python
projects, but a similar approach is required for other projects.
On my side, this is because instead of having [uwsgi]
as the header of my configuration inside /etc/uwsgi/apps-available/
, I put something else (the name of the app).
I had similar issue but this solved it (btw, I use MacOs, and both python2&3 versions installed, but I wanted to use Python3):
- Open terminal and check for python3 location by typing:
which python3
- Copy the full path and assign it to; plugins option in .ini file
I hope it helps!
Just stumbled upon this error message and wasted a couple of hours, yet in my case the cause was different from everything mentioned in other answers already.
Suppose you just installed a local uWSGI version via pip
into your own virtualenv (e.g. as described here).
Suppose you are now trying to run your uWSGI server as root (because you want to serve the app as www-data
user, for example). This is how you would do it, right?
. venv/bin/activate
sudo uwsgi --ini your-app.ini
Wrong! Even though your local uwsgi
is in your path after you activated your environment, this path is not passed into the sudo
command, and you are launching the system uwsgi
rather than your local one, which may be the source of endless confusion, like it was in my case.
So, the solution in my case was to simply specify the full path:
sudo /full/path/to/venv/bin/uwsgi --ini your-app.ini
If you’ve followed all the python plugin installation steps and uwsgi --plugin-list
still fails to list 0: python
as one of the plugins, try restarting your computer. My uwsgi instance ran as a service (from Bash, use service status-all
to see running services) and probably the updated config settings were loaded on service restart.
if you are using python3:
install plugin:
sudo apt install uwsgi-plugin-python3
add uwsgi python3 plugin line in your site config (.ini file):
plugins = python3
and if you want to list your uwsgi’s python plugins list:
ls -l /usr/lib/uwsgi/plugins/ | grep python
KEEP IN MIND python3 plugin is different from python2.
If you do not define python’s plugin uwsgi says:
!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!
no request plugin is loaded, you will not be able to manage requests.
you may need to install the package for your language of choice, or simply load it with --plugin.
!!!!!!!!!!! END OF WARNING !!!!!!!!!!
if you use python2’s plugin and your venv is in python3 it says:
ImportError: No module named site