当前位置:   article > 正文

完美解决 Python library not found: libpython3.10m.dylib, Python3, .Python, lib...

pythonlibrarynotfounderror: python library not found: libpython3.10.so, libp

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

```sh 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.

  1. * On Debian/Ubuntu, you need to install Python development packages:
  2. * apt-get install python3-dev
  3. * apt-get install python-dev
  4. * If you are building Python by yourself, rebuild with `--enable-shared` (or, `--enable-framework` on macOS).

```

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

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

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

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

sh $ env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.10.3

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

sh $ pyinstaller -F -w xx.py

sh .... .... 493 INFO: Moving BUNDLE data files to Resource directory 494 INFO: Signing the BUNDLE... 552 INFO: Building BUNDLE BUNDLE-00.toc completed successfully.

iShot<em>2022-11-20</em>01.34.46.png

本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号