I am trying to use the hq-git Mercurial extension on Windows (Windows 7 requires a 64-bit version). I have Mercurial and Git installed. I have Python 2.5 (32-bit) installed.
I followed the instructions at http://hg-git.github.com/ to install the extension. The original easy_install failed because it could not compile dulwich without Visual Studio 2003.
I installed dulwich manually:
- git clone git: //git.samba.org/jelmer/dulwich.git
- cd dulwich
- c: \ Python25 \ python setup.py --pure install
Now when I run easy_install hg-git, it succeeds (since the dulwich dependency is running).
In my C: \ Users \ username \ Mercurial.ini I have:
[extensions] hgext.bookmarks = hggit =
When I type 'hg' on the command line, I see: "*** failed to import the hggit extension: there is no module named hggit"
In my c: \ Python25 folder, the only hggit link I can see is Lib\site-packages\hg_git-0.2.1-py2.5.egg . Is it supposed to be extracted somewhere, or should it work as is?
Since this failed, I tried to follow the “more attractive” instructions on the hg-git page, which suggested cloning git: //github.com/schacon/hg-git.git and a link to the path to my Mercurial configuration. I cloned the repo and modified the extensions file to look like this:
[extensions] hgext.bookmarks = hggit = c:\code\hg-git\hggit
Now, when I run hg, I see: *** failed to import the hggit extension from c: \ code \ hg- git \ hggit: there is no module named dulwich.errors.
So this tells me that now it finds hggit, because I see in hg- git \ hggit \ git_handler.py that it calls
from dulwich.errors import HangupException
This makes me think that dulwich is installed incorrectly or not in the way.
Update:
From the Python command line:
import dulwich
gives Import Error: No module named dulwich
However, in the C: \ Python25 \ Lib \ site-packages folder, I have a dulwich-0.5.0-py2.5.egg folder, which seems to be populating. This was created by the steps above. Is there another step I should take to make it part of the Python “path”?
From the Python command line (as suggested in one of the answers):
import pkg_resources pkg_resources.require('dulwich')
gives [dulwich 0.5.0 (c:\python25\lib\site-packages\dulwich-0.5.0-py2.5.egg)]
So what does that tell me? Import dulwich failed, but apparently pkg_resources can find it. What can I do with this information?