Unable to find "/Library/Python/3.7m/include/pyconfig.h" in Mac OS X Catalina?

Viewed 762

Environment:

Python 3.7.3

Mac OS X Catalina 10.15.6

Problem:

I try to compile my Python 3.7 script in a Mac OS app file. I use this command:

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

But I get some error:

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)

I download and installed python from python.org

I don't have skills to compile a new python.

When I search for solutions, I only found ones for Linux systems.

So I tried to install with brew:

brew install python

But it didn't fix my issue. I still have same error message.

How can I fix that please?

1 Answers

I faced the same issue recently. I have reinstalled by Xcode and python3 by looking into the below youtube video:

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

Install pyinstaller using pip.

Generate the exec application: python -m PyInstaller yourfilename.py

Related