pip-installed uWSGI ./python_plugin.so error

Question:

I’ve installed uWSGI using pip and start it up with an XML to load my application. The XML config contains <plugin>python</plugin>. On my new server it leads to an error:

open("./python_plugin.so"): No such file or directory [core/utils.c line 3321]
!!! UNABLE to load uWSGI plugin: ./python_plugin.so: cannot open shared object file: No such file or directory !!!

I can find the .c and the .o versions:

sudo find / -name 'python_plugin.c'
/srv/www/li/venv/build/uwsgi/build/uwsgi/plugins/python/python_plugin.c
/srv/www/li/venv/build/uwsgi/plugins/python/python_plugin.c
sudo find / -name 'python_plugin.o'
/srv/www/li/venv/build/uwsgi/build/uwsgi/plugins/python/python_plugin.o
/srv/www/li/venv/build/uwsgi/plugins/python/python_plugin.o
sudo find / -name 'python_plugin.so'

But no .so found. My previous system had a uwsgi install through apt-get, but that’s really old (and I’m quite sure it uses the pip installed uwsgi normally, but maybe not for shared objects then?)

Some background info:

  • Ubuntu 12.0.4 LTS
  • Python 2.7 (virtualenv)
  • I’ve installed uWSGI in my venv, using the normal pip install uwsgi (no sudo)

So I’m a tad clueless 🙁 I can’t be the only person in the world to have this, right? Should I compile the .so objects myself? (If so, how?) Or is there another great solution?

Asked By: Carst

||

Answers:

Distros should package uWSGI in a modular way, with each feature as a plugin. But when you install using language specific ways (pip, gem…) the relevant language is embedded, so you do not need to load the plugin

Answered By: roberto

For anyone that is having trouble with this, basically you need to remove lines that state your plugin from your configuration files if you change from a distro package to a pypi or gem install. I was previously using the Ubuntu/Debian package for uwsgi, but it was old so I upgraded to use pip instead.

So, in my configuration .ini file, I had the following line:

plugin = python

Removing that line fixes the problem.

Answered By: Jordan

Maybe you forgot this command

$ apt-get install uwsgi-plugin-python

If you’re using Python3, try this command instead:

$ apt-get install uwsgi-plugin-python3
Answered By: Zhengquan Feng

Install all available plugins: sudo apt-get install uwsgi-plugins-all

Answered By: Mahdi

As of 6/2018 the yum package name was updated from uwsgi-plugin-python to uwsgi-plugin-python2 https://src.fedoraproject.org/rpms/uwsgi/pull-request/4#

The new install command is therefore yum install uwsgi-plugin-python2

Answered By: LandyCandy
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.