uwsgi部署web,error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory

使用的是miniconda2安装的python,并且加入了环境变量,可是uwsgi部署web时候仍然报错error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory

可以在环境变量中添加
export LD_LIBRARY_PATH="/root/miniconda2/lib" ,这里的/roo/miniconda2是指我的python安装路径

也可以使用find / -name libpython2.7.so.1.0找到这个路径。

如果是使用supervisor部署的,在程序的配置文件设置environment =LD_LIBRARY_PATH="/root/miniconda2/lib/",这样就能解决了找不到这个文件。



原文地址:https://www.cnblogs.com/ydf0509/p/7772712.html