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

getting an error when trying to run uwsgi: error while loading shared libraries: libpython3.4m.so.1.0

我一直在这样运行 uwsgi:

uwsgi --ini CMS_uwsgi.ini

它曾经有效。然而,我在几周后再次尝试 运行 uwsgi,现在我得到了这个错误:

uwsgi: error while loading shared libraries: libpython3.4m.so.1.0:
cannot open shared object file: No such file or directory

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

sudo apt-get autoremove

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

我试图通过运行找到它:

find -name "libpython3.4m.so.1.0"

但它没有 return 任何东西。知道如何解决这个问题吗?

我正在使用 Lubuntu。

找到答案了。首先,做了

pip uninstall uwsgi

然后再次尝试安装:

pip install uwsgi

但它给了我错误:

plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory

我 google 转了一圈发现了这个 post: https://askubuntu.com/questions/182313/install-uwsgi-1-2-5-via-pip 提到要安装

sudo apt-get install python2.7-dev

所以我安装了 python2.7-dev 并重试安装了 uwsgi 但得到了同样的错误。意识到我正在使用 python3,遇到这个 post: Cannot install uWSGI on Ubuntu 14.04 with Python 3.4 (paths?) 提到要做

sudo apt-get install python3-dev

我这样做了,然后重新安装 uwsgi,它再次运行良好。

如果你想在虚拟环境中运行 uwsgi。然后运行以下

pip install python-pcre

现在,尝试 运行启用 wsgi。希望这对您有所帮助!