当前位置:   article > 正文

完美解决 Python library not found: libpython3.10m.dylib, Python3, .Python, libpython3...._this means your python installation does not come

this means your python installation does not come with proper shared library

mac 电脑上使用 $ pyinstaller -F -w xx.py 打包 Python 文件报错:

OSError: Python library not found: Python, libpython3.10.dylib, .Python, Python3, libpython3.10m.dylib
    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).
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

在打包过程中遇到了打包不成功的问题,看报错是 python 缺少动态库,重点错误提示:

If you are building Python by yourself, rebuild with '--enable-shared' (or, '--enable-framework' on macOS).

附:pyenv install 下载安装慢(失败)完美解决,可以快速重新安装编译好。

那么重新编译下安装下,重装要用的版本,重新编译后就会有这些动态库了:

$ env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.10.3
  • 1

编译完成,然后再次打包,成功 !!!

$ pyinstaller -F -w xx.py
  • 1
....
....
493 INFO: Moving BUNDLE data files to Resource directory
494 INFO: Signing the BUNDLE...
552 INFO: Building BUNDLE BUNDLE-00.toc completed successfully.
  • 1
  • 2
  • 3
  • 4
  • 5

请添加图片描述

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

闽ICP备14008679号