Python library not found: libpython2.7mu.so.1.0

在使用pyinstaller生成python可执行文件的时候,包错误,提示有几个依赖的库找不到:Python library not found: libpython2.7mu.so.1.0

参考stackoverflow解决方法:


install python-devel openssl openssl-devel gcc sqlite-devel
wget http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tar.bz2
tar -xvjf Python-2.7.5.tar.bz2
cd Python-2.7.5
./configure --prefix=/usr/local/python2.7 --with-threads --enable-shared
make
make install altinstall
ln -s /usr/local/python2.7/lib/libpython2.7.so /usr/lib
ln -s /usr/local/python2.7/lib/libpython2.7.so.1.0 /usr/lib
ln -s /usr/local/python2.7/bin/python2.7 /usr/local/bin
/sbin/ldconfig -v
echo "alias python='/usr/local/python2.7/bin/python2.7'" >> ~/.bashrc
source ~/.bashrc
python -V
评论说这种方法修改了系统文件,会有风险,所以使用之前还需要三思!

ref:

https://stackoverflow.com/questions/26597527/how-to-install-libpython2-7-so 

https://stackoverflow.com/questions/14677359/pyinstaller-cannot-find-libpython2-7-so-when-making-binary 

原文地址:https://www.cnblogs.com/buxizhizhoum/p/7778899.html