No module named dulwich.errors

OSXHg Mercurial Python

When trying to use the hg-git extension to mercurial on OSX Catalina I got:

*** failed to import extension hggit from /foo/bar/dev/hg-git/hggit: No module named dulwich.errors

To fix, I installed the python 2 dulwich via pip. I then copied the python 2.7 dulwich package from my main site-packages to the homebrew hg site-packages:

/usr/local/Cellar/mercurial/5.1.1_2/lib/python2.7/site-packages

Then everything worked fine in the convert. All the other instructions online were too complicated.