diff --git a/python/mozboot/bin/bootstrap.py b/python/mozboot/bin/bootstrap.py index 0b7399eec88c..3dd41dfd2924 100755 --- a/python/mozboot/bin/bootstrap.py +++ b/python/mozboot/bin/bootstrap.py @@ -227,7 +227,17 @@ def clone(vcs, no_interactive): print('Mercurial is not installed. Mercurial is required to clone ' 'Firefox%s.' % ( ', even when cloning with Git' if vcs == 'git' else '')) - print('Try installing hg with `pip3 install Mercurial`.') + try: + # We're going to recommend people install the Mercurial package with + # pip3. That will work if `pip3` installs binaries to a location + # that's in the PATH, but it might not be. To help out, if we CAN + # import "mercurial" (in which case it's already been installed), + # offer that as a solution. + import mercurial # noqa: F401 + print('Hint: have you made sure that Mercurial is installed to a ' + 'location in your PATH?') + except ImportError: + print('Try installing hg with `pip3 install Mercurial`.') return None if vcs == 'hg': binary = hg