jish / pre-commit

A slightly improved pre-commit hook for git
https://jish.github.io/pre-commit/
Other
796 stars 96 forks source link

"pre-commit run --all-files" Not working --> OSError #198

Closed zonito closed 9 years ago

zonito commented 9 years ago

pre-commit install pre-commit run --all-files

I get below error, please guide me, what do i need to do...

/usr/local/bin/pre-commit:5: UserWarning: Module _markerlib was already imported from /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc, but /Library/Python/2.7/site-packages/distribute-0.6.49-py2.7.egg is being added to sys.path
  from pkg_resources import load_entry_point

An unexpected error has occurred: OSError: [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pre_commit/error_handler.py", line 34, in error_handler
    yield
  File "/Library/Python/2.7/site-packages/pre_commit/main.py", line 129, in main
    return run(runner, args)
  File "/Library/Python/2.7/site-packages/pre_commit/commands/run.py", line 165, in run
    return _run_hooks(runner, args, write=write, environ=environ)
  File "/Library/Python/2.7/site-packages/pre_commit/commands/run.py", line 115, in _run_hooks
    for repo in runner.repositories:
  File "/Library/Python/2.7/site-packages/cached_property.py", line 26, in __get__
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/Library/Python/2.7/site-packages/pre_commit/runner.py", line 43, in repositories
    repository.require_installed()
  File "/Library/Python/2.7/site-packages/pre_commit/repository.py", line 58, in require_installed
    self.install()
  File "/Library/Python/2.7/site-packages/pre_commit/repository.py", line 71, in install
    language.install_environment(self.cmd_runner, language_version)
  File "/Library/Python/2.7/site-packages/pre_commit/languages/python.py", line 31, in install_environment
    repo_cmd_runner.run(venv_cmd)
  File "/Library/Python/2.7/site-packages/pre_commit/prefixed_command_runner.py", line 41, in run
    return cmd_output(*replaced_cmd, __popen=self.__popen, **kwargs)
  File "/Library/Python/2.7/site-packages/pre_commit/util.py", line 148, in cmd_output
    proc = __popen(cmd, **popen_kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 709, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1326, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
jish commented 9 years ago

Hello, that looks like a Python stack trace. This is the pre-commit RubyGem. Is this the right place for this issue?

If so, we'll be glad to help you debug your problem. :)

zonito commented 9 years ago

I fixed this issue, and i guess, not right place.. but i had posted to all right places too... thought of inputs from experts.