Python 3.x 找不到“/Library/Python/3.7m/include/pyconfig.h“;在MacOSXCatalina中?

Python 3.x 找不到“/Library/Python/3.7m/include/pyconfig.h“;在MacOSXCatalina中?,python-3.x,macos,pyinstaller,Python 3.x,Macos,Pyinstaller,环境: Python 3.7.3 MacOSXCatalina 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 an

环境:

Python 3.7.3

MacOSXCatalina 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
但这并没有解决我的问题。我仍然有相同的错误消息


请问我如何解决这个问题?

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

使用pip安装pyinstaller

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