尝试运行uwsgi时出错:加载共享库时出错:libpython3.4m.so.1.0

use*_*875 0 mod-wsgi uwsgi python-3.x

我一直在这样跑uwsgi

uwsgi --ini CMS_uwsgi.ini
Run Code Online (Sandbox Code Playgroud)

它曾经可以工作。但是,uwsgi几周后,我尝试再次运行,现在出现此错误:

uwsgi: error while loading shared libraries: libpython3.4m.so.1.0:
cannot open shared object file: No such file or directory
Run Code Online (Sandbox Code Playgroud)

我不确定为什么现在会出现此错误。可能是因为最近我做了

sudo apt-get autoremove
Run Code Online (Sandbox Code Playgroud)

删除曾经作为依赖安装但不再存在的已安装软件包(如此处所述https://askubuntu.com/questions/187888/what-is-the-correct-way-to-completely-remove-an -应用)。

我试图通过运行找到它:

find -name "libpython3.4m.so.1.0"
Run Code Online (Sandbox Code Playgroud)

但它没有返回任何东西。关于如何解决此问题的任何想法?

我正在使用Lubuntu。

use*_*875 5

找到了答案。首先,做了

pip uninstall uwsgi
Run Code Online (Sandbox Code Playgroud)

然后尝试再次安装它:

pip install uwsgi
Run Code Online (Sandbox Code Playgroud)

但是它给了我错误:

plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory
Run Code Online (Sandbox Code Playgroud)

我在Google周围搜索并发现了以下帖子:https ://askubuntu.com/questions/182313/install-uwsgi-1-2-5-via-pip 提到要安装

sudo apt-get install python2.7-dev
Run Code Online (Sandbox Code Playgroud)

所以我安装python2.7-dev并重试安装,uwsgi但出现相同的错误。意识到我正在使用python3,碰到了这篇文章:无法在使用Python 3.4的Ubuntu 14.04上安装uWSGI(路径?),提到这样做

sudo apt-get install python3-dev
Run Code Online (Sandbox Code Playgroud)

我这样做了,然后尝试安装uwsgi,它再次正常工作。