当前位置:   article > 正文

pyinstaller -F xxx.py报告OSError: Python library not found:_oserror: python library not found: libpython3.7.so

oserror: python library not found: libpython3.7.so.1.0, libpython3.7mu.so.1.

OSError: Python library not found: libpython3.7.so.1.0, libpython3.7m.so.1.0, libpython3.7.so, libpython3.7m.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).

问题出现:Ubuntu18.04系统,原有的python3.6 安装了pyinstaller执行没问题;安装新的python3.7 之后;没有调整python3的环境变量,运行pyinstaller就会报错

问题解决:

1. 需要修改环境映射python3.7到python3,参考下面的链接:

ubuntu18.04升级python3.6到python3.7_51CTO博客_python2.7升级python3

做到python3.6和python3.7自由切换,千万不要随意删除3.6,ubuntu18.04系统可能有问题,桌面可能就没了。

2. 安装文件:

根据问题提示 进行下面开发包的安装

 sudo apt-get install python3-dev
 sudo apt-get install python-dev

按照这样的执行,根本就解决不了问题;

正确的安装是对应python版本的开发包:

sudo apt-get install libpython3.7-dev

之后熟悉的成功封装的结果又出来了:

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/723770
推荐阅读
相关标签
  

闽ICP备14008679号