FileNotFoundError: [Errno 2] No such file or directory: 'hg': 'hg'


I am running repo2docker but getting the error

Traceback (most recent call last):
File “/opt/miniconda3/bin/repo2docker”, line 33, in
sys.exit(load_entry_point(‘jupyter-repo2docker’, ‘console_scripts’, ‘repo2docker’)())
File “/path/repo2docker/repo2docker/”, line 378, in main
File “/path/repo2docker/repo2docker/”, line 802, in start
File “/path/repo2docker/repo2docker/”, line 712, in build
self.fetch(self.repo, self.ref, checkout_path)
File “/path/repo2docker/repo2docker/”, line 423, in fetch
spec = cp.detect(url, ref=ref)
File “/path/repo2docker/repo2docker/contentproviders/”, line 19, in detect
File “/opt/miniconda3/lib/python3.7/”, line 395, in check_output
File “/opt/miniconda3/lib/python3.7/”, line 472, in run
with Popen(*popenargs, **kwargs) as process:
File “/opt/miniconda3/lib/python3.7/”, line 775, in init
restore_signals, start_new_session)
File “/opt/miniconda3/lib/python3.7/”, line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: ‘hg’: ‘hg’

Any idea what I might be doing wrong? Thanks so much!

That error means repo2docker hasn’t detected that your repository as a Git repo, and is instead attempting to use mercurial which isn’t installed.

Adding .git works for me: repo2docker I think GitHub autoredirects git requests to the .git sufffix if it’s missing but maybe GitLab doesn’t?


OMG! Thanks so much!!

1 Like