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

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

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.

* 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 下载安装慢(失败)完美解决,可以快速重新安装编译好。

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

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.

相关文章
|
2月前
|
数据采集 机器学习/深度学习 人工智能
2024最新版Python安装教程,适合新手,赶快收藏!_python3最新版2024
2024最新版Python安装教程,适合新手,赶快收藏!_python3最新版2024
|
26天前
|
JSON 程序员 数据格式
豆瓣评分9.6!用81个项目带你从Python 3零基础到Python自动化
Python的名字来自超现实主义的英国喜剧团体,而不是来自蛇。Python程序员被亲切地称为Pythonistas。Monty Python和与蛇相关的引用常常出现在Python的指南和文档中。
|
1月前
|
JSON 程序员 数据格式
豆瓣评分9.6!用81个项目带你从Python 3零基础到Python自动化
Python的名字来自超现实主义的英国喜剧团体,而不是来自蛇。Python程序员被亲切地称为Pythonistas。Monty Python和与蛇相关的引用常常出现在Python的指南和文档中。
|
2月前
|
数据采集 SQL 数据挖掘
2024最新版Python安装教程,适合新手,赶快收藏!_python3最新版2024(1)
2024最新版Python安装教程,适合新手,赶快收藏!_python3最新版2024(1)
|
2月前
|
数据采集 数据挖掘 Python
[Github高赞文章]python2愉快地迁移到Python3_code changing from python2 to python3(2)
[Github高赞文章]python2愉快地迁移到Python3_code changing from python2 to python3(2)
|
2月前
|
数据采集 机器学习/深度学习 人工智能
2024最新版Python安装教程,适合新手,赶快收藏!_python3最新版2024(3)
2024最新版Python安装教程,适合新手,赶快收藏!_python3最新版2024(3)
|
2月前
|
Python
【Python3 查询手册学习】,完整版PDF开放下载_python速查手册·模块卷(全彩版) pdf(1)
【Python3 查询手册学习】,完整版PDF开放下载_python速查手册·模块卷(全彩版) pdf(1)
|
2月前
|
Linux 数据安全/隐私保护 iOS开发
如何将python命令链接到Python3
如何将python命令链接到Python3
28 0
|
2月前
|
数据采集 机器学习/深度学习 人工智能
Python环境搭建—安装Python3解释器
Python环境搭建—安装Python3解释器
40 2
|
2月前
|
数据采集 JavaScript C++
Python搭建编程环境-安装Python3解释器
Python搭建编程环境-安装Python3解释器
31 1