无法在 Mac OS X Catalina 中找到"/Library/Python/3.7m/include/pyconfig.h"?



环境:

Python 3.7.3

Mac OS X Catalina 10.15.6

问题:

我尝试在Mac OS应用程序文件中编译我的Python 3.7脚本。我使用这个命令:

python3 -m PyInstaller --windowed --icon=myapp_icon.icns myapp.py

但我遇到了一些错误:

Unable to find "/Library/Python/3.7m/include/pyconfig.h" when adding binary and data files.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.org 下载并安装了python

我没有编译新python的技能。

当我搜索解决方案时,我只找到了适用于Linux系统的解决方案。

所以我试着用brew安装:

brew install python

但它并没有解决我的问题。我仍然有相同的错误信息。

我该怎么修?

我最近也遇到了同样的问题。我已经通过Xcode和python3重新安装,通过查看以下youtube视频:

https://www.youtube.com/watch?v=0rg6nyanX5Y&t=635s

使用pip安装pyinstaller。

生成exec应用程序:python-m PyInstaller yourfilename.py

最新更新