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.

The path python3.7 (from --python=python3.7) does not exist

See original GitHub issue

I’m trying to use black on pre-commit, by using this settings:

repos:
-   repo: https://github.com/ambv/black
    rev: stable
    hooks:
    - id: black
      language_version: python3.7

Unfortuntely I get this error: (it doesn’t happen if I try to format with python3.6)

### version information

pre-commit version: 1.21.0
sys.version:
    2.7.15 (default, Jan 12 2019, 21:07:57) 
    [GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)]
sys.executable: /usr/local/opt/python@2/bin/python2.7
os.name: posix
sys.platform: darwin


### error information


An unexpected error has occurred: CalledProcessError: command: ('/usr/local/opt/python@2/bin/python2.7', '-mvirtualenv', '/Users/user name/.cache/pre-commit/repoi4s0y8j6/py_env-python3.7', '-p', 'python3.7')
return code: 3
expected return code: 0
stdout:
    The path python3.7 (from --python=python3.7) does not exist

stderr: (none)

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pre_commit/error_handler.py", line 72, in error_handler
    yield
  File "/usr/local/lib/python2.7/site-packages/pre_commit/main.py", line 344, in main
    return run(args.config, store, args)
  File "/usr/local/lib/python2.7/site-packages/pre_commit/commands/run.py", line 292, in run
    install_hook_envs(hooks, store)
  File "/usr/local/lib/python2.7/site-packages/pre_commit/repository.py", line 220, in install_hook_envs
    hook.install()
  File "/usr/local/lib/python2.7/site-packages/pre_commit/repository.py", line 98, in install
    self.prefix, self.language_version, self.additional_dependencies,
  File "/usr/local/lib/python2.7/site-packages/pre_commit/languages/python.py", line 169, in install_environment
    _make_venv(env_dir, python)
  File "/usr/local/lib/python2.7/site-packages/pre_commit/languages/python.py", line 181, in make_venv
    cmd_output_b(*cmd, env=env, cwd='/')
  File "/usr/local/lib/python2.7/site-packages/pre_commit/util.py", line 141, in cmd_output_b
    raise CalledProcessError(returncode, cmd, retcode, stdout_b, stderr_b)
CalledProcessError: command: ('/usr/local/opt/python@2/bin/python2.7', '-mvirtualenv', '/Users/user name/.cache/pre-commit/repoi4s0y8j6/py_env-python3.7', '-p', 'python3.7')
return code: 3
expected return code: 0
stdout:
    The path python3.7 (from --python=python3.7) does not exist

stderr: (none)

Any ideas on how to solve it?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
nibu147commented, Feb 27, 2020

it’s actually installed on my machine (python3.7 command works in my shell), but it seems it’s not found. what could be the reason? thanks!

1reaction
JelleZijlstracommented, Jan 23, 2020

Sounds like you need to install Python 3.7.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"The path python3 (from --python=python3) does not exist" error
try something like this, here C:/Python36/python.exe give the full address of python3 executable virtualenv env -p C:/Python36/python.exe.
Read more >
The Path Python3 (From --Python=Python3) Does Not Exist
The path python3 (from --python=python3) does not exist error indicates that the path Python3 does not exist. This can be caused by many ......
Read more >
Can't make virtualenv with Python3 : Forums - PythonAnywhere
The executable python3 (from --python=python3) does not exist. I'm stumped. I already had set up a virtual env with python 2.7 (suggestion: ...
Read more >
Unable to upgrade Python 3.8.10 to 3.10 - SOLVED
Python 3.8 is the default version that comes with Ubuntu But the latest ... error: alternative path /usr/bin/python3.10 doesn't exist.
Read more >
The path =python3.9 (from --python==python3.9) does not exist ...
virtualenv --python=python3 fibonacci_env. ... The path python2 (from --python=python2) does not exist. python by Distinct Dormouse on Apr 29 2020 Comment.
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