question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not working on macOS Sierra?

See original GitHub issue

Attempting to utilize a collection of hooks from the default repo, I get the following:

An unexpected error has occurred: CalledProcessError: Command: ('/Users/amcgregor/Projects/marrow/.venv/bin/python3', '-m', 'virtualenv', '/Users/amcgregor/.pre-commit/repofu57ylaa/py_env-default')
Return code: 100
Expected return code: 0
Output: 
    Using base prefix '/usr/local/bin/../../../Library/Frameworks/Python.framework/Versions/3.5'
    New python executable in /Users/amcgregor/.pre-commit/repofu57ylaa/py_env-default/bin/python3
    Also creating executable in /Users/amcgregor/.pre-commit/repofu57ylaa/py_env-default/bin/python
    ERROR: The executable /Users/amcgregor/.pre-commit/repofu57ylaa/py_env-default/bin/python3 is not functioning
    ERROR: It thinks sys.prefix is '/Library/Frameworks/Python.framework/Versions/3.5' (should be '/Users/amcgregor/.pre-commit/repofu57ylaa/py_env-default')
    ERROR: virtualenv is not compatible with this system or executable

Errors: (none)

Traceback (most recent call last):
  File "/Users/amcgregor/Projects/marrow/.venv/lib/python3.5/site-packages/pre_commit/error_handler.py", line 47, in error_handler
    yield
  File "/Users/amcgregor/Projects/marrow/.venv/lib/python3.5/site-packages/pre_commit/main.py", line 157, in main
    return run(runner, args)
  File "/Users/amcgregor/Projects/marrow/.venv/lib/python3.5/site-packages/pre_commit/commands/run.py", line 212, in run
    return _run_hooks(repo_hooks, args, write, environ)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Users/amcgregor/Projects/marrow/.venv/lib/python3.5/site-packages/pre_commit/staged_files_only.py", line 63, in staged_files_only
    yield
  File "/Users/amcgregor/Projects/marrow/.venv/lib/python3.5/site-packages/pre_commit/commands/run.py", line 195, in run
    repo_hooks = list(get_repo_hooks(runner))
  File "/Users/amcgregor/Projects/marrow/.venv/lib/python3.5/site-packages/pre_commit/commands/run.py", line 141, in get_repo_hooks
    for repo in runner.repositories:
  File "/Users/amcgregor/Projects/marrow/.venv/lib/python3.5/site-packages/cached_property.py", line 26, in __get__
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/Users/amcgregor/Projects/marrow/.venv/lib/python3.5/site-packages/pre_commit/runner.py", line 47, in repositories
    repository.require_installed()
  File "/Users/amcgregor/Projects/marrow/.venv/lib/python3.5/site-packages/pre_commit/repository.py", line 117, in require_installed
    self.install()
  File "/Users/amcgregor/Projects/marrow/.venv/lib/python3.5/site-packages/pre_commit/repository.py", line 187, in install
    self.additional_dependencies[language_name][language_version],
  File "/Users/amcgregor/Projects/marrow/.venv/lib/python3.5/site-packages/pre_commit/languages/python.py", line 78, in install_environment
    ('pip', 'install', '.') + additional_dependencies,
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Users/amcgregor/Projects/marrow/.venv/lib/python3.5/site-packages/pre_commit/util.py", line 58, in clean_path_on_failure
    yield
  File "/Users/amcgregor/Projects/marrow/.venv/lib/python3.5/site-packages/pre_commit/languages/python.py", line 74, in install_environment
    repo_cmd_runner.run(venv_cmd)
  File "/Users/amcgregor/Projects/marrow/.venv/lib/python3.5/site-packages/pre_commit/prefixed_command_runner.py", line 39, in run
    return cmd_output(*replaced_cmd, __popen=self.__popen, **kwargs)
  File "/Users/amcgregor/Projects/marrow/.venv/lib/python3.5/site-packages/pre_commit/util.py", line 189, in cmd_output
    returncode, cmd, retcode, output=(stdout, stderr),
pre_commit.util.CalledProcessError: Command: ('/Users/amcgregor/Projects/marrow/.venv/bin/python3', '-m', 'virtualenv', '/Users/amcgregor/.pre-commit/repofu57ylaa/py_env-default')
Return code: 100
Expected return code: 0
Output: 
    Using base prefix '/usr/local/bin/../../../Library/Frameworks/Python.framework/Versions/3.5'
    New python executable in /Users/amcgregor/.pre-commit/repofu57ylaa/py_env-default/bin/python3
    Also creating executable in /Users/amcgregor/.pre-commit/repofu57ylaa/py_env-default/bin/python
    ERROR: The executable /Users/amcgregor/.pre-commit/repofu57ylaa/py_env-default/bin/python3 is not functioning
    ERROR: It thinks sys.prefix is '/Library/Frameworks/Python.framework/Versions/3.5' (should be '/Users/amcgregor/.pre-commit/repofu57ylaa/py_env-default')
    ERROR: virtualenv is not compatible with this system or executable

Errors: (none)

Using the Python.org-provided Python 3.5 installer package. I’m already within a virtual environment at the point of execution.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
amcgregorcommented, Oct 25, 2016
awk '/tests_require \+ ['pre-commit']/ { print "\t\t\t'development': tests_require + ['pre-commit>=0.9.2'],  # Development requirements are the testing requirements."; next }1'

That should do the vast majority of my projects that avoid declaring additional (non-test) development requirements. I use a similar awk approach in my venv construction shell function to patch the activate script. 😉

1reaction
asottilecommented, Oct 25, 2016

This is available in 0.9.2 \o/

Read more comments on GitHub >

github_iconTop Results From Across the Web

macOS Sierra problems: Here's how to fix the most common ...
macOS Sierra problems: Here's how to fix the most common issues · 1. Shut down the device · 2. Plug in the power...
Read more >
12 Most Common macOS Sierra Problems and How to Fix Them
1. Not enough storage for macOS Sierra · 2. macOS Sierra installation is slow · 3. macOS Sierra install frozen · 4. Mac...
Read more >
macOS Sierra Installation issue! - Apple Community
I have received this message "An error occurred while preparing the installation. Try running this application again.
Read more >
macOS Sierra Not Working, How-To fix Common Problems
Mac Will Not Start after macOS Sierra Update · Restart your Mac and hold down Command, Option, P and R keys to reset...
Read more >
How to Fix Common macOS High Sierra Problems - MacKeeper
Try Safe Mode. Booting to Safe Mode may resolve installation issues that occur in the initial stages of the process. If the problem...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found