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

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

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).

在打包过程中遇到了打包不成功的问题,看报错是 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

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

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

相关文章
|
3月前
|
SQL 数据库连接 数据库
Python3 notes
Python3 notes
|
小程序 Linux 区块链
Python PyInstaller 打包成 Win、Mac 应用程序(app / exe)
Python PyInstaller 打包成 Win、Mac 应用程序(app / exe)
1293 0
|
10月前
|
SQL 关系型数据库 Apache
Apache Doris 系列: 入门篇-创建数据表
Apache Doris 系列: 入门篇-创建数据表
475 0
|
11月前
|
JavaScript 前端开发
React craco 解决 webpack < 5 used to include polyfills for node.js core ...
React craco 解决 webpack < 5 used to include polyfills for node.js core ...
548 0
|
3月前
|
iOS开发 MacOS Python
完美解决 Python library not found: libpython3.10m.dylib, Python3, .Python, libpython3....
完美解决 Python library not found: libpython3.10m.dylib, Python3, .Python, libpython3....
118 0
|
3月前
|
Shell iOS开发 MacOS
完美解决 Python library not found: libpython3.10m.dylib, Python3, .Python, lib...
完美解决 Python library not found: libpython3.10m.dylib, Python3, .Python, lib...
114 0
|
10月前
|
存储 监控 调度
OpenStack
OpenStack
194 0
|
11月前
|
Java 应用服务中间件 Linux
阿里云服务器配置遇到的一些问题总结
阿里云服务器配置遇到的一些问题总结
196 0
|
12月前
|
Python
中文LLM测评
下面是针对 Modelscope 的代码相关;写作创作;中文游戏三个方面的问题,并附上一段测评内容。
136 0
|
安全 网络协议 Shell
Docker API未授权漏洞复现
Docker API未授权漏洞复现
836 0