Installing python on MacBook Air failed

when I open the installation after downloading I approve everything and then when the installation starts it ends and writes "installation software
encounters a problem that prevents the completion of the installation. contact the manufacturer for help.

author important information:
at first when I reached installation it asked me to approve that python can reach my files (I think downloads files and I refused for the first time, and since then the installation stucks, and I tried to reverse it in the next instalations, and I didn’t succeed , because that question didn’t apear again on the next installations, and I always get failure ever since

my Mac is brand new

please help me solve this puzzle
cannot install python on my Mac

This is a issue that some mac users are seeing, but not all.

This thread has the discussion so far about this problem:

It seems that this works for a lot of people:

The next cut of the installers will mention (see gh #103207:

macOS 13 Ventura users: due to an issue with macOS Installer app, installation of some third-party packages including this Python package may fail with a vague “The installer encountered an error” message if the Installer app does not have permission to access the folder containing the downloaded installer file, typically in the Downloads folder. Go to System Settings → Privacy & Security → Files and Folders, then click the mark in front of Installer to expand, and enable Downloads Folder by moving the toggle to the right. See https:// for up-to-date information on this issue.

I found the solution at last
on the Mac took me a lot of video on YouTube to watch
this is my first Mac
system setting > privacy > files > remove it. then click installer agains should be able to allow