Skip to content

Installation on macOS fails with "The installer encountered an error" #103207

Description

@ronaldoussoren

Thread on discuss: https://discuss.python.org/t/is-there-a-recent-mac-install-issue/23755/20

There are sporadic reports of errors during the installation of Python on macOS using our installer in which "Installer.app" gives a vague generic error, in particular “The installer encountered an error”.

This appears to be related to system security settings. In particular, the Installer.app needs access to the install package and hence needs the right to access the "Downloads" folder (for most users) or possibly "Full Disk Access" (for users storing the package outside of the Downloads folder).

The system normally asks the user to approve such access the first time the permissions are needed, but only once. If a user (accidentally) does not approve the system won't ask for permissions later on.

To fix the error:

  • Go to System Settings (or System Preferences), "Security & Privacy"
  • On Ventura: Look for "Files & Folders" and then "Installer". Make sure "Downloads" folder is present and enabled
  • On Ventura: (If previous step doesn't work or fix the issue): Look for "Full Disk Access" and then check that "Installer" is present and enabled (you can add the application using the "+" button at the bottom when it isn't present).

A different workaround for users: Install using the installer(1) command line tool.

On my system (where installing Python using the installer Works):

  • "Files & Folders": Installer is present and has access to "Downloads"
  • "Full Disk Access": Installer is present but does not have this permission enabled

At this time it is not clear what we can do about this other than documenting this (website, installer start page)

Linked PRs

Activity

  1. ronaldoussoren commented on Apr 3, 2023

    @ronaldoussoren
    ContributorAuthor

    I've filed a feedback with Apple: FB12093803

    This feedback was filed in the "other" category because Feedback Assistant does not have an option for filing feedback about Installer.app (there is an option that seem related, but that's for the macOS installer, not Installer.app).

  2. added 6 commits that reference this issue on Apr 4, 2023
  3. ned-deily commented on Apr 4, 2023

    @ned-deily
    Member

    After some experimentation, I believe Ronald's description of the failure being seen is correct. At this point, it appears that for macOS 13 Venture there were changes in macOS and the macOS Installer.app such that there are now cases when installing a third-party package, like python.org Python for macOS, cause macOS to ask the user to confirm giving the macOS Installer app permission to access one of the set of special folders given additional security in Ventura, including the user's Documents and Downloads folders. macOS remembers the decision made by the user and, if the user does not give permission by clicking on the right button intentionally or not, the Installer app is unable to complete the installation and eventually fails with the above-mentioned cryptic message. Based on some of the installer log messages, I conjecture that the problem might be limited to downloaded installer files that are meta-packages, i.e. an mpkg consisting of multiple pkg installers, like the python.org installers.

    Regardless, the solution is, as Ronald notes, to enable Install access to the Downloads (or other special folder) via System Settings.

    I haven't yet encountered a situation where "Full Disk Access" is needed for this issue. The command line tool workaround mentioned in the thread undoubtedly works because of the use of sudo to override permissions.

    Until such time as Apple fixes the installer or another solution is found, I have added the following note to the Welcome screen of python.org installers, beginning with Python 3.10.11, 3.11.3, and 3.12.0a7, all of which should be released within the next few days:

    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://github.com/python/cpython/issues/103207 for up-to-date information on this issue.

  4. hugovk commented on Apr 5, 2023

    @hugovk
    Member

    With python-3.12.0a7-macos11.pkg on macOS Ventura 13.2.1, the bold formatting needs tweaking for dark mode:

    Details image

    It's visible when I highlight:

    Details image

    Or switch to light mode:

    Details image

    For comparison, bold is working on the next page:

    Details image

    (Other than that, it installed fine. I downloaded from https://www.python.org/downloads/release/python-3120a7/ into /tmp/downloads (I've set my browser downloads to there, so they're autodeleted when I restart), and then double clicked it from the Finder.)

  5. ned-deily commented on Apr 5, 2023

    @ned-deily
    Member

    With python-3.12.0a7-macos11.pkg on macOS Ventura 13.2.1, the bold formatting needs tweaking for dark mode:

    Thanks for the headsup. This was also reported in #103290. The macOS Installer.app has long used RTF files for the Welcome and ReadMe screens. While we don't change these files a lot, I've not run into this problem before - we did already have bold text there before - so I didn't think to test installing with dark mode on. Grr! FWIW, the files render correctly in TextEdit in dark mode so there's probably some new rendering stuff that TextEdit supports but the Installer app doesn't.

    So the workaround is to change to light mode when installing, but I should be able to provide updated installer files with just the Welcome file replaced. I will work on that and also check with the 3.12 and 3.11/3.10 release managers if a stealth update of the macOS installer files is acceptable in this case; it will mean that the checksums and sigstore info will change for them as well. (For the record, we've tried in the past to post updated installer files under a slightly different file name but found that caused problems for users who rely on scripts to auto-download release files based on an expected file name pattern.)

  6. added 3 commits that reference this issue on Apr 6, 2023
  7. 1 remaining item

  8. added 2 commits that reference this issue on Apr 6, 2023
  9. added a commit that references this issue on Apr 8, 2023
  10. added 2 commits that reference this issue on Apr 11, 2023
  11. ronaldoussoren commented on Apr 14, 2023

    @ronaldoussoren
    ContributorAuthor

    I've filed a feedback with Apple: FB12093803

    This feedback was filed in the "other" category because Feedback Assistant does not have an option for filing feedback about Installer.app (there is an option that seem related, but that's for the macOS installer, not Installer.app).

    Apple mentions that the current macOS 13.4 beta (22F5037d) contains a change that might be relevant for this. System behaviour seems to have changed in a VM that runs this beta: Installer.app is not in the "Files & Folder" section, installing from the Downloads folder adds the folder to this section (after asking for permission), and after installation Installer.app is removed from the system settings again.

    I haven't installed this beta on my main machine so cannot say if this change actually fixes the issue that I described in the initial message of this issue.

  12. added 7 commits that reference this issue on May 23, 2023
  13. ned-deily commented on May 24, 2023

    @ned-deily
    Member

    I have confirmed that macOS 13.4 does resolve this problem. As @ronaldoussoren found with the 13.4 beta, in the final 13.4 release the macOS Installer.app seems to always ask for permission to access the Downloads folder even if you have denied access on a previous install attempt, unlike in pre-13.4 Ventura releases. I've updated the Welcome screen of active python.org installer packages accordingly; they will appear in 3.11.4 and 3.12.0b2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-mactype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions