赞
踩
MACOS Pyinstaller 打包生成文件时报错:
OSError: Python library not found: libpython3.7m.dylib, .Python, libpython3.7.dylib, Python
This would mean your Python installation doesn't come with proper library files.
This usually happens by missing development package, or unsuitable build parameters of Python installation.
* On Debian/Ubuntu, you would need to install Python development packages
* apt-get install python3-dev
* apt-get install python-dev
* If you're building Python by yourself, please rebuild your Python with `--enable-shared` (or, `--enable-framework` on Darwin)
我的python是用pyenv安装的,所以一般博客中重新编译Python对我来说不好使。在这里给出pyenv重新安装python并解决python lib not found问题。
PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.10.5
./pip uninstall pyinstaller
,./pip install pyinstaller
./pyinstaller -F -w test.py --onefile
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。