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

Hello,

I am running repo2docker https://gitlab.inria.fr/mgenet/MEC552-Demo 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/main.py”, line 378, in main
r2d.start()
File “/path/repo2docker/repo2docker/app.py”, line 802, in start
self.build()
File “/path/repo2docker/repo2docker/app.py”, line 712, in build
self.fetch(self.repo, self.ref, checkout_path)
File “/path/repo2docker/repo2docker/app.py”, line 423, in fetch
spec = cp.detect(url, ref=ref)
File “/path/repo2docker/repo2docker/contentproviders/mercurial.py”, line 19, in detect
stderr=subprocess.DEVNULL,
File “/opt/miniconda3/lib/python3.7/subprocess.py”, line 395, in check_output
**kwargs).stdout
File “/opt/miniconda3/lib/python3.7/subprocess.py”, line 472, in run
with Popen(*popenargs, **kwargs) as process:
File “/opt/miniconda3/lib/python3.7/subprocess.py”, line 775, in init
restore_signals, start_new_session)
File “/opt/miniconda3/lib/python3.7/subprocess.py”, 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 https://gitlab.inria.fr/mgenet/MEC552-Demo.git. I think GitHub autoredirects git requests to the .git sufffix if it’s missing but maybe GitLab doesn’t?

2 Likes

OMG! Thanks so much!!

1 Like