2

How can I use mercurial_keyring with TortoiseHg on mac?

Guides usually installs mercurial_keyring with pip install or easy_install but it doesn't work for TortoiseHG on mac.

And TortoiseHg ends up with error:

No module named mercurial_keyring

jrbedard
  • 3,662
  • 5
  • 30
  • 34
Petr Kramolis
  • 245
  • 2
  • 12

1 Answers1

2

The thing is that TortoiseHg ignores modules installed with pip or easy_install on mac os.

Instead you have to copy mercurial_keyring.py, mercurial_extension_utils.py and keyring (whole keyring folder) to TortoiseHg.app contents python folder:

TortoiseHg.app/Contents/Resources/lib/python2.7/

You can do so by going to applications and right click on TortoiseHG.app then select Show Package Contents

The modules version can make difference too so make sure you pick right modules for your tortoiseHG version.

Links to modules:

Credit goes to "Anonymous" in TortoiseHg mailing list

Petr Kramolis
  • 245
  • 2
  • 12
  • Last link to mailing list does not seem to work, at least for me. By any chance you're referring to [this one](https://bitbucket.org/tortoisehg/thg/issues/4634/mercurial-keyring-is-not-available-in)? – superjos Jan 24 '19 at 09:19
  • Updated links: https://pypi.org/project/mercurial_extension_utils/ https://pypi.org/project/mercurial_keyring/ and the two .py files need to go into TortoiseHg.app/Contents/Resources/lib/python2.7/hgext – O'Rooney Sep 30 '21 at 22:17
  • I should add that I saw there is already a keyring folder, in TortoiseHg 5.9.1. – O'Rooney Sep 30 '21 at 22:52
  • However I now get an error: keyring: keyring backend doesn't seem to work, password was not saved. Error details: No recommended backend was available. Install a recommended 3rd party backend package; or, install the keyrings.alt package if you want to use the non-recommended backends. See https://pypi.org/project/keyring for details. – O'Rooney Sep 30 '21 at 22:53