No Such File or Directory when mercurial not installed
I attempted to run "flake8 --install-hook" on the following system:
- Fedora 22
- Python 2.7.10
- Flake8 2.5.1
It gave me the following error:
Traceback (most recent call last):
File "/usr/bin/flake8", line 11, in <module>
sys.exit(main())
File "/usr/lib/python2.7/site-packages/flake8/main.py", line 30, in main
install_hook()
File "/usr/lib/python2.7/site-packages/flake8/hooks.py", line 266, in install_hook
vcs = find_vcs()
File "/usr/lib/python2.7/site-packages/flake8/hooks.py", line 163, in find_vcs
_, hg_dir, _ = run('hg root')
File "/usr/lib/python2.7/site-packages/flake8/hooks.py", line 128, in run
p = Popen(command.split(), stdout=PIPE, stderr=PIPE)
File "/usr/lib64/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib64/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
The run('hg root') was a bit of a clue. I installed mercurial and the error went away.