If you recently purchased a new Mac/Macbook or had a fresh installation of the latest macOS on your device (macOS Sonoma) you will see that when you run a python3 command on the Terminal you get a popup that says.
The "python3" command requires the command line developer tools.
Would you like to install the tools now?
Choose Install to download and install the command line developer tools now.
Cancel Install
This is because you need additional xcode-select tools are required to be installed on your system in order to run Python.
Code2care@Mac % python3
xcode-select: note: No developer tools were found, requesting install.
If developer tools are located at a non-default location on disk, use `sudo xcode-select --switch path/to/Xcode.app`
to specify the Xcode that you wish to use for command line developer tools, and cancel the installation dialog.
See `man xcode-select` for more details.
So click install and follow the instructions in order to run Python on your Mac.
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!

Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!