How do I correctly install dulwich to get hg-git working on Windows?
- by Joshua Flanagan
I'm trying to use the hg-git Mercurial extension on Windows (Windows 7 64-bit, to be specific). I have Mercurial and Git installed. I have Python 2.5 (32-bit) installed.
I followed the instructions on http://hg-git.github.com/ to install the extension. The initial easy_install failed because it was unable to compile dulwich without Visual Studio 2003.
I installed dulwich manually by:
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 satisfied).
In my C:\Users\username\Mercurial.ini, I have:
[extensions]
hgext.bookmarks =
hggit =
When I type 'hg' at a command prompt, I see:
"* failed to import extension hggit: No module named hggit"
Looking under my c:\Python25 folder, the only reference to hggit I see is Lib\site-packages\hg_git-0.2.1-py2.5.egg. Is this supposed to be extracted somewhere, or should it work as-is?
Since that failed, I attempted the "more involved" instructions from the hg-git page that suggested cloning git://github.com/schacon/hg-git.git and referencing the path in my Mercurial configuration. I cloned the repo, and changed my extensions file to look like:
[extensions]
hgext.bookmarks =
hggit = c:\code\hg-git\hggit
Now when I run hg, I see: * failed to import extension hggit from c:\code\hg-git\hggit: No module named dulwich.errors.
Ok, so that tells me that it is finding hggit now, because I can see in hg-git\hggit\git_handler.py that it calls
from dulwich.errors import HangupException
That makes me think dulwich is not installed correctly, or not in the path.
Update:
From Python command line:
import dulwich
yields Import Error: No module named dulwich
However, under C:\Python25\Lib\site-packages, I do have a dulwich-0.5.0-py2.5.egg folder which appears to be populated. This was created by the steps mentioned above. Is there an additional step I need to take to make it part of the Python "path"?