pip 安装的 uWSGI ./python_plugin.so 错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15936413/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-18 21:24:55  来源:igfitidea点击:

pip-installed uWSGI ./python_plugin.so error

pythonuwsgi

提问by Carst

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:

我已经使用 pip 安装了 uWSGI,并使用 XML 启动它来加载我的应用程序。XML 配置包含<plugin>python</plugin>. 在我的新服务器上,它导致错误:

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 .cand the .oversions:

我可以找到.c.o版本:

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?)

但是没有找到。我以前的系统通过 apt-get 安装了 uwsgi,但这真的很旧(而且我很确定它通常使用 uwsgi 安装的 pip,但可能不适用于共享对象?)

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)
  • Ubuntu 12.0.4 LTS
  • Python 2.7(虚拟环境)
  • 我已经在我的 venv 中安装了 uWSGI,使用的是正常的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 .soobjects myself? (If so, how?) Or is there another great solution?

所以我有点无能为力:(我不可能是世界上唯一拥有这个的人,对吧?我应该自己编译.so对象吗?(如果是,怎么做?)或者有另一个很好的解决方案吗?

采纳答案by roberto

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

发行版应该以模块化方式打包 uWSGI,将每个功能作为插件。但是当您使用特定于语言的方式(pip、gem...)安装时,相关语言已嵌入,因此您无需加载插件

回答by Jordan

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.

对于遇到此问题的任何人,如果您从发行版软件包更改为 pypi 或 gem 安装,基本上您需要从配置文件中删除说明您的插件的行。我以前在 uwsgi 中使用 Ubuntu/Debian 包,但它很旧,所以我升级为使用 pip。

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

因此,在我的配置 .ini 文件中,我有以下行:

plugin = python

Removing that line fixes the problem.

删除该行可以解决问题。

回答by Zhengquan Feng

Maybe you forgot this command

也许你忘记了这个命令

$ apt-get install uwsgi-plugin-python

回答by mahdix

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

安装所有可用的插件: sudo apt-get install uwsgi-plugins-all

回答by LandyCandy

As of 6/2018 the yumpackage name was updated from uwsgi-plugin-pythonto uwsgi-plugin-python2https://src.fedoraproject.org/rpms/uwsgi/pull-request/4#

截至 2018 年 6 月,yum软件包名称已更新uwsgi-plugin-pythonuwsgi-plugin-python2https://src.fedoraproject.org/rpms/uwsgi/pull-request/4#

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

因此,新的安装命令是yum install uwsgi-plugin-python2