How do I correctly install dulwich to get hg-git working on Windows?

后端 未结 10 2059
执念已碎
执念已碎 2021-01-31 01:35

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.

<
10条回答
  •  佛祖请我去吃肉
    2021-01-31 02:11

    Based on techtonik's explanation of the reason for the failing import of dulwich.errors, I found a solution which appears simpler to me than the already proposed ones:

    On the Mercurial download page there is offered

    Mercurial for Python 2.7 on Windows x86 (source install)

    and

    Mercurial for Python 2.7 on Windows x64 (source install)

    as .EXE files which install Mercurial as a Python module into an existing Python 2.7 (x86 or x64) installation.

    If hg-git and dulwich have been installed to this Python installation as well, the import errors should vanish.

    If you are not sure what to do now, I hope this step-by-step explanation helps:

    Prerequisites

    • Python 2.7 is installed
    • and \Scripts are in the PATH environment variable
    • hg-git (and dulwich) have been installed into this Python installation via the instructions from here

    Steps

    1. Deinstall any existing Mercurial installation
    2. Download and install one of the above-quoted EXE files, depending on whether your Python 2.7 installation is 32bit or 64bit (If you get a "Python 2.7 cannot be found in registry" error, you probably need the other one.)

    Now hg clone should work on the console.

提交回复
热议问题