Alex Rivera | Logout

Mercurial extensions not working in Windows 7 x64?

Asked 2010-04-02T00:10:09.660
15

We are test driving Mercurial at work. We don't want to have to enter our user/pass each time we interact with a repository, so we set up the mercurial_keyring extension. We:

  • Installed Python 2.6.5 (32 or 64 bit, depending on the system)
  • Installed setuptools (for easy_install.exe)
  • easy_install keyring
  • easy_install mercurial_keyring

And then made the appropriate changes to %userprofile%/mercurial.ini in the [auth] section. It works fine on my colleague's computer (32bit xp sp3), but it does not work on my machine (Windows 7 Ultimate x64). Also noteworthy, the setuptools had to be built from source on Win 7 x64 (python setup.py bdist_wininst, then run the resulting setuptools-0.6c11.win-amd64.exe).

Using just hg.exe from the Mercurial 1.5 binary installation (the .msi), I get this error when I run hg.exe:

*** failed to import extension mercurial_keyring: No module named mercurial_keyring

I tried to change my mercurial.ini, to specify the path to the mercurial_keyring.py file, instead of having mercurial find it (since it's in the PYTHONPATH).

Old:

[extensions]
mercurial_keyring =

New:

[extensions] mercurial_keyring =
c:/mercurial/extensions/mercurial_keyring.py

The error changes to:

abort: could not import module keyring!

So while providing the path to the mercurial_keyring extension works, the dependent keyring module still cannot be found.

After further investigation, it appears that NO extensions work. They all produce the error:

*** failed to import extension [extension name]: No module named [module name]

It appears that when running hg.exe, it is not aware of PYTHONPATH. I have tried:

  • Python 2.6.5 32 bit
  • Python 2.6.5 64 b
Edit
Report

1 Answer

19

Answering my own question with my previous update, since there are no other takers yet.

Suitable workaround: Since TortoiseHG does work with mercurial_keyring, I've simply changed my PATH to include the tortoiseHG folder, and exclude c:\mercurial. Now when I type "hg" at the command line, it's using the hg.exe in the tortoiseHG folder, which works fine with the keyring.

answered 2010-04-02T19:35:09.880

Your Answer