Software⏱️ 3 min read📅 2026-06-11

How to Fix: Keyring.backend error TortoiseHg on Mac

Fixing keyring backend error in TortoiseHg on Mac OS Mojave.

Quick Answer: Remove the [backend] line from the hgrc file and create the necessary folders and keyringrc.cfg file using the instructions from https://stackoverflow.com/questions/54192177/how-can-i-get-the-keyring-extension-working-for-mercurial-in-ubuntu-18-04

The error 'No handlers could be found for logger keyring.backend' in TortoiseHg on Mac OS Mojave is frustrating and can prevent users from successfully pushing changes. This issue affects Mac users who have installed Python keyring and are using it with TortoiseHg.

Despite the lack of specific guidance available, resolving this error requires a combination of understanding how keyring works on MacOS and making adjustments to the hgrc file. In this guide, we will walk you through the steps to resolve this issue.

🔍 Why This Happens

  • The primary reason for this error is that the MacOS version of Tortoise HG does not include the keyring library by default. This means that the 'mercurial_keyring' line in the hgrc file is not recognized.
  • Another possible cause is that the Python installation did not create the necessary folders and files required for the keyring extension to work.

✅ Best Solutions to Fix It

Configuring the hgrc file

  1. Step 1: Open the hgrc file in a text editor, such as TextEdit or Sublime Text.
  2. Step 2: Remove the line '[backend]' from the hgrc file, as it is not necessary for keyring to work.
  3. Step 3: Save the changes and close the file.
  4. Step 4: Restart Tortoise HG by running 'hg update' or 'hg push' again.
  5. Step 5: If the issue persists, proceed to the next method.

Creating the keyringrc.cfg file

  1. Step 1: Open a terminal window and navigate to the directory where you installed Python.
  2. Step 2: Run the command 'python -m keyring.backend.osx.keyring.create_keyring' to create the necessary folders and files for keyring.
  3. Step 3: Copy the output from the command into the hgrc file, replacing the existing '[backend]' line.
  4. Step 4: Save the changes and close the file.
  5. Step 5: Restart Tortoise HG by running 'hg update' or 'hg push' again.
  6. Step 6: If the issue persists, you may need to adjust the priority of the keyring backend in the hgrc file.

🎯 Final Words

To resolve the 'No handlers could be found for logger keyring.backend' error in TortoiseHg on Mac OS Mojave, try configuring the hgrc file by removing the '[backend]' line and restarting the application. If this fails, create the necessary folders and files using the keyring backend command and copy the output into the hgrc file.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions