pyinstaller centos 打包记录
运行pyinstaller xx.py
报错1:OSError: Python library not found: libpython3.7mu.so.1.0, libpython3.7.so, l
这个是因为缺少 libpython3.7开发工具导致,centos可以通过yum install python3-devel。如果依然报错可能是因为版本不一致导致,可以在编译安装的时候添加参数重新安装python
./configure --enable-shared #后面加多这个参数
make install
然后找到libpython3.7mu.so.1.0的所在位置。
报错2:error while loading shared libraries: libpython3.7m.so.1.0: cannot open shared object file: No such
解决方法:
添加库的配置信息,将python/lib的绝对路径(一般为:’/usr/python/lib’),添加至conf文件中。
切换至/etc/ld.so.conf.d目录下,打开python3.conf文件:
[root@centos]# cd /etc/ld.so.conf.d
[root@centos]# vim python3.conf
进入vim,将/usr/python/lib作为一行插入,保存退出。
运行ldconfig命令:
[root@centos]# ldconfig