pyinstaller 打包exe遇到If you are building Python by yourself, rebuild with `--enable-shared` (or, `--en
2022/6/23 1:23:25
本文主要是介绍pyinstaller 打包exe遇到If you are building Python by yourself, rebuild with `--enable-shared` (or, `--en,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
环境:pyenv + python3.8.5 +Macos
测试代码
testExe.py#!/usr/bin/env python # coding=utf-8 if __name__ == "__main__": print("测试打包exe")
执行步骤
- pyenv local 3.8.5 #已经安装对应的版本前提下
- pip install pyinstaller
- pyinstall -D testExe.py
详细报错
* 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-frameworkon macOS)
由于使用的是pyenv多版本 所以需要重新安装对应的python版本 执行
env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.7.0
重新安装python并指定
PYTHON_CONFIGURE_OPTS="--enable-framework" #仅限macos系统
这篇关于pyinstaller 打包exe遇到If you are building Python by yourself, rebuild with `--enable-shared` (or, `--en的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-05-08有遇到过吗?同样的规则 Excel 中 比Python 结果大
- 2024-03-30开始python成长之路
- 2024-03-29python optparse
- 2024-03-29python map 函数
- 2024-03-20invalid format specifier python
- 2024-03-18pool.map python
- 2024-03-18threads in python
- 2024-03-14python Ai 应用开发基础训练,字符串,字典,文件
- 2024-03-13id3 algorithm python
- 2024-03-13sum array elements python