解决 pyinstaller 出现的不能打包的问题

 

 

复制代码
错误详情:
OSError: Python library not found: libpython3.7m.so, libpython3.7.so.1.0, libpython3.7m.so.1.0, libpython3.7.so, libpython3.7mu.so.1.0
This means your Python installation does not come with proper shared library files.
This usually happens due to missing development package, or unsuitable build parameters of the Python installation.

* On Debian/Ubuntu, you need to install Python development packages:
* apt-get install python3-dev
* apt-get install python-dev
* If you are building Python by yourself, rebuild with `--enable-shared` (or, `--enable-framework` on macOS).
复制代码
复制代码
解决方案:
- 重新编译 Python3
- 1. 进入Python 编译目录
   执行命令:
    ./configure --prefix=/usr/local/python3 --enable-shared --with-ssl
- 2. 进行编译
   make && make install

- 3.  查看动态库情况
   ldd /usr/local/python3/bin/python3
   查看 libpython3.7m.so.1.0 是否存在
- 4. 拷贝文件
   cp /usr/local/python3/lib/libpython3.7m.so.1.0 /usr/lib64/
复制代码

 在没有进行第四步的时候, 执行 python3 都是提示 这行红色标记的 so 的没有找到

  在执行完第四步, 这里就显示有个 so 了

 

  在下载, pip3 install pyinstaller 

  测试, 打包单个文件

 

posted @   Handsome、Snake  阅读(635)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 提示词工程——AI应用必不可少的技术
· 字符编码:从基础到乱码解决
· 地球OL攻略 —— 某应届生求职总结
点击右上角即可分享
微信分享提示